提交 4988010d 编写于 作者: S Sandeep Somavarapu

Use toResource method in workspace context service

上级 a781a325
......@@ -320,18 +320,14 @@ export class PreferencesService extends Disposable implements IPreferencesServic
return null;
}
const workspace = this.contextService.getWorkspace();
return workspace.configuration || this.toResource(paths.join('.vscode', 'settings.json'), workspace.folders[0].uri);
return workspace.configuration || this.contextService.toResource(paths.join('.vscode', 'settings.json'), workspace.folders[0]);
case ConfigurationTarget.FOLDER:
const folder = this.contextService.getWorkspaceFolder(resource);
return folder ? this.toResource(paths.join('.vscode', 'settings.json'), folder.uri) : null;
return folder ? this.contextService.toResource(paths.join('.vscode', 'settings.json'), folder) : null;
}
return null;
}
private toResource(relativePath: string, root: URI): URI {
return URI.file(paths.join(root.fsPath, relativePath));
}
private createSettingsIfNotExists(target: ConfigurationTarget, resource: URI): TPromise<void> {
if (this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE && target === ConfigurationTarget.WORKSPACE) {
if (!this.configurationService.keys().workspace.length) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册