Merge from vscode b8c2e7108b3cae7aa2782112da654bedd8bb3a52 (#4808)

This commit is contained in:
Karl Burtram
2019-04-02 14:35:06 -07:00
committed by GitHub
parent e83a6f9c2e
commit f8706abebe
53 changed files with 495 additions and 584 deletions

View File

@@ -164,7 +164,7 @@ async function createSnippetFile(scope: string, defaultPath: URI, windowService:
}
async function createLanguageSnippetFile(pick: ISnippetPick, fileService: IFileService) {
if (await fileService.existsFile(URI.file(pick.filepath))) {
if (await fileService.exists(URI.file(pick.filepath))) {
return;
}
const contents = [

View File

@@ -121,11 +121,11 @@ function watch(service: IFileService, resource: URI, callback: (type: FileChange
}
}
});
service.watchFileChanges(resource);
service.watch(resource);
return {
dispose() {
listener.dispose();
service.unwatchFileChanges(resource);
service.unwatch(resource);
}
};
}
@@ -277,7 +277,7 @@ class SnippetsService implements ISnippetsService {
private _initWorkspaceFolderSnippets(workspace: IWorkspace, bucket: IDisposable[]): Promise<any> {
let promises = workspace.folders.map(folder => {
const snippetFolder = folder.toResource('.vscode');
return this._fileService.existsFile(snippetFolder).then(value => {
return this._fileService.exists(snippetFolder).then(value => {
if (value) {
this._initFolderSnippets(SnippetSource.Workspace, snippetFolder, bucket);
} else {
@@ -305,7 +305,7 @@ class SnippetsService implements ISnippetsService {
if (type === FileChangeType.DELETED) {
return Promise.resolve();
}
return this._fileService.resolveFile(folder).then(stat => {
return this._fileService.resolve(folder).then(stat => {
for (const entry of stat.children || []) {
disposables.push(this._addSnippetFile(entry.resource, source));
}