mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 03:29:00 +01:00
Merge branch 'joh/next'
This commit is contained in:
@@ -382,7 +382,7 @@ export interface MainThreadFileSystemShape extends IDisposable {
|
||||
$unregisterProvider(handle: number): void;
|
||||
|
||||
$onFileSystemChange(handle: number, resource: IFileChangeDto[]): void;
|
||||
$reportFileChunk(handle: number, session: number, chunk: number[] | null): void;
|
||||
$reportFileChunk(handle: number, session: number, base64Encoded: string | null): void;
|
||||
|
||||
$handleFindMatch(handle: number, session, data: UriComponents | [UriComponents, ILineMatch]): void;
|
||||
}
|
||||
@@ -561,7 +561,7 @@ export interface ExtHostFileSystemShape {
|
||||
$utimes(handle: number, resource: UriComponents, mtime: number, atime: number): TPromise<IStat>;
|
||||
$stat(handle: number, resource: UriComponents): TPromise<IStat>;
|
||||
$read(handle: number, session: number, offset: number, count: number, resource: UriComponents): TPromise<number>;
|
||||
$write(handle: number, resource: UriComponents, content: number[]): TPromise<void>;
|
||||
$write(handle: number, resource: UriComponents, base64Encoded: string): TPromise<void>;
|
||||
$unlink(handle: number, resource: UriComponents): TPromise<void>;
|
||||
$move(handle: number, resource: UriComponents, target: UriComponents): TPromise<IStat>;
|
||||
$mkdir(handle: number, resource: UriComponents): TPromise<IStat>;
|
||||
|
||||
@@ -43,6 +43,10 @@ export class ExtHostDecorations implements ExtHostDecorationsShape {
|
||||
return TPromise.join(requests.map(request => {
|
||||
const { handle, uri, id } = request;
|
||||
const provider = this._provider.get(handle);
|
||||
if (!provider) {
|
||||
// might have been unregistered in the meantime
|
||||
return void 0;
|
||||
}
|
||||
return asWinJsPromise(token => provider.provideDecoration(URI.revive(uri), token)).then(data => {
|
||||
result[id] = data && <DecorationData>[data.priority, data.bubble, data.title, data.abbreviation, data.color, data.source];
|
||||
}, err => {
|
||||
|
||||
@@ -15,6 +15,7 @@ import { IPatternInfo } from 'vs/platform/search/common/search';
|
||||
import { values } from 'vs/base/common/map';
|
||||
import { Range } from 'vs/workbench/api/node/extHostTypes';
|
||||
import { ExtHostLanguageFeatures } from 'vs/workbench/api/node/extHostLanguageFeatures';
|
||||
import { IProgress } from 'vs/platform/progress/common/progress';
|
||||
|
||||
class FsLinkProvider implements vscode.DocumentLinkProvider {
|
||||
|
||||
@@ -109,15 +110,19 @@ export class ExtHostFileSystem implements ExtHostFileSystemShape {
|
||||
return asWinJsPromise(token => this._fsProvider.get(handle).stat(URI.revive(resource)));
|
||||
}
|
||||
$read(handle: number, session: number, offset: number, count: number, resource: UriComponents): TPromise<number> {
|
||||
const progress = {
|
||||
const progress: IProgress<Uint8Array> = {
|
||||
report: chunk => {
|
||||
this._proxy.$reportFileChunk(handle, session, [].slice.call(chunk));
|
||||
let base64Chunk = Buffer.isBuffer(chunk)
|
||||
? chunk.toString('base64')
|
||||
: Buffer.from(chunk.buffer).toString('base64');
|
||||
|
||||
this._proxy.$reportFileChunk(handle, session, base64Chunk);
|
||||
}
|
||||
};
|
||||
return asWinJsPromise(token => this._fsProvider.get(handle).read(URI.revive(resource), offset, count, progress));
|
||||
}
|
||||
$write(handle: number, resource: UriComponents, content: number[]): TPromise<void, any> {
|
||||
return asWinJsPromise(token => this._fsProvider.get(handle).write(URI.revive(resource), Buffer.from(content)));
|
||||
$write(handle: number, resource: UriComponents, base64Content: string): TPromise<void, any> {
|
||||
return asWinJsPromise(token => this._fsProvider.get(handle).write(URI.revive(resource), Buffer.from(base64Content, 'base64')));
|
||||
}
|
||||
$unlink(handle: number, resource: UriComponents): TPromise<void, any> {
|
||||
return asWinJsPromise(token => this._fsProvider.get(handle).unlink(URI.revive(resource)));
|
||||
|
||||
Reference in New Issue
Block a user