提交 cf44fd64 编写于 作者: A Andre Weinand

remove getEnvironmentService from IVariableAccessor

上级 4cce36ad
......@@ -547,8 +547,8 @@ export class ExtHostVariableResolverService implements IConfigurationResolverSer
getConfigurationValue: (folderUri: URI, section: string) => {
return configuration.getConfiguration(undefined, folderUri).get<string>(section);
},
getEnvironmentService: (name: string): string => {
return undefined;
getExecPath: (): string | undefined => {
return undefined; // does not exist in EH
},
getFilePath: (): string | undefined => {
const activeEditor = editors.activeEditor();
......@@ -561,7 +561,6 @@ export class ExtHostVariableResolverService implements IConfigurationResolverSer
return undefined;
},
getSelectedText: (): string | undefined => {
debugger;
const activeEditor = editors.activeEditor();
if (activeEditor && !activeEditor.selection.isEmpty) {
return activeEditor.document.getText(activeEditor.selection);
......
......@@ -45,8 +45,8 @@ export class ConfigurationResolverService implements IConfigurationResolverServi
getConfigurationValue: (folderUri: uri, suffix: string) => {
return configurationService.getValue<string>(suffix, folderUri ? { resource: folderUri } : undefined);
},
getEnvironmentService: (name: string) => {
return environmentService[name];
getExecPath: () => {
return environmentService['execPath'];
},
getFilePath: (): string | undefined => {
let input = editorService.getActiveEditorInput();
......
......@@ -17,7 +17,7 @@ export interface IVariableAccessor {
getFolderUri(folderName: string): uri | undefined;
getWorkspaceFolderCount(): number;
getConfigurationValue(folderUri: uri, section: string): string | undefined;
getEnvironmentService(name: string): string | undefined;
getExecPath(): string | undefined;
getFilePath(): string | undefined;
getSelectedText(): string | undefined;
getLineNumber(): string;
......@@ -193,7 +193,11 @@ export class VariableResolver {
return basename.slice(0, basename.length - paths.extname(basename).length);
case 'execPath':
return this.accessor.getEnvironmentService('execPath');
const ep = this.accessor.getExecPath();
if (ep) {
return ep;
}
throw new Error(localize('canNotResolveExecPath', "'{0}' can not be resolved.", match));
default:
return match;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册