Skip to content

Commit 11a1ce9

Browse files
committed
variable susbtitution: only strings are supported
1 parent 63cffb9 commit 11a1ce9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/vs/workbench/services/configurationResolver/electron-browser/configurationResolverService.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import { IProcessEnvironment } from 'vs/base/common/platform';
2020
import { VariableResolver } from 'vs/workbench/services/configurationResolver/node/variableResolver';
2121
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
2222
import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
23+
import { isUndefinedOrNull } from 'vs/base/common/types';
24+
import { localize } from 'vs/nls';
2325

2426

2527
export class ConfigurationResolverService implements IConfigurationResolverService {
@@ -146,11 +148,13 @@ export class ConfigurationResolverService implements IConfigurationResolverServi
146148
}
147149

148150
return this.commandService.executeCommand<string>(commandId, configuration).then(result => {
149-
if (result) {
151+
if (typeof result === 'string') {
150152
commandValueMapping[interactiveVariable] = result;
151-
} else {
153+
} else if (isUndefinedOrNull(result)) {
152154
cancelled = true;
153155
}
156+
157+
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)));
154158
});
155159
};
156160
});

0 commit comments

Comments
 (0)