提交 a89383b3 编写于 作者: I isidor

debug user launch: resolve variables against a folder if you are in a folder vscode

上级 6cacaef5
......@@ -573,6 +573,10 @@ class Launch implements ILaunch {
return config.configurations.filter(config => config && config.name === name).shift();
}
protected getWorkspaceForResolving(): IWorkspaceFolder {
return this.workspace;
}
public resolveConfiguration(config: IConfig): TPromise<IConfig> {
const result = objects.deepClone(config) as IConfig;
// Set operating system specific properties #1873
......@@ -589,7 +593,7 @@ class Launch implements ILaunch {
// massage configuration attributes - append workspace path to relatvie paths, substitute variables in paths.
Object.keys(result).forEach(key => {
result[key] = this.configurationResolverService.resolveAny(this.workspace, result[key]);
result[key] = this.configurationResolverService.resolveAny(this.getWorkspaceForResolving(), result[key]);
});
const adapter = this.configurationManager.getAdapter(result.type);
......@@ -690,11 +694,20 @@ class UserLaunch extends Launch implements ILaunch {
@IWorkbenchEditorService editorService: IWorkbenchEditorService,
@IConfigurationService configurationService: IConfigurationService,
@IConfigurationResolverService configurationResolverService: IConfigurationResolverService,
@IPreferencesService private preferencesService: IPreferencesService
@IPreferencesService private preferencesService: IPreferencesService,
@IWorkspaceContextService private contextService: IWorkspaceContextService
) {
super(configurationManager, undefined, fileService, editorService, configurationService, configurationResolverService);
}
protected getWorkspaceForResolving(): IWorkspaceFolder {
if (this.contextService.getWorkbenchState() === WorkbenchState.FOLDER) {
return this.contextService.getWorkspace().folders[0];
}
return undefined;
}
get uri(): uri {
return this.preferencesService.userSettingsResource;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册