提交 11a1ce91 编写于 作者: I isidor

variable susbtitution: only strings are supported

上级 63cffb9c
......@@ -20,6 +20,8 @@ import { IProcessEnvironment } from 'vs/base/common/platform';
import { VariableResolver } from 'vs/workbench/services/configurationResolver/node/variableResolver';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
import { isUndefinedOrNull } from 'vs/base/common/types';
import { localize } from 'vs/nls';
export class ConfigurationResolverService implements IConfigurationResolverService {
......@@ -146,11 +148,13 @@ export class ConfigurationResolverService implements IConfigurationResolverServi
}
return this.commandService.executeCommand<string>(commandId, configuration).then(result => {
if (result) {
if (typeof result === 'string') {
commandValueMapping[interactiveVariable] = result;
} else {
} else if (isUndefinedOrNull(result)) {
cancelled = true;
}
return TPromise.wrapError(new Error(localize('stringsOnlySupported', "Command {0} did not return a string result. Only strings are supported as results for commands used for variable substitution.", commandId)));
});
};
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册