Skip to content

Commit 4f5231f

Browse files
alexr00digitarald
authored andcommitted
Make easy adoptions of async configuation resolver service (#120326)
* Make easy adoptions of async configuation resolver service Part of #108804 * Also adopt in exthostDebug * Add another terminal adoption
1 parent a4d136f commit 4f5231f

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

src/vs/workbench/api/common/extHostDebugService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ export abstract class ExtHostDebugServiceBase implements IExtHostDebugService, E
384384
}
385385
};
386386
}
387-
return this._variableResolver.resolveAny(ws, config);
387+
return this._variableResolver.resolveAnyAsync(ws, config);
388388
}
389389

390390
protected createDebugAdapter(adapter: IAdapterDescriptor, session: ExtHostDebugSession): AbstractDebugAdapter | undefined {

src/vs/workbench/contrib/searchEditor/browser/searchEditorActions.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,13 @@ export const openNewSearchEditor =
137137

138138
const seedSearchStringFromSelection = _args.location === 'new' || configurationService.getValue<IEditorOptions>('editor').find!.seedSearchStringFromSelection;
139139
const args: OpenSearchEditorArgs = { query: seedSearchStringFromSelection ? selected : undefined };
140-
Object.entries(_args).forEach(([name, value]) => {
140+
for (const entry of Object.entries(_args)) {
141+
const name = entry[0];
142+
const value = entry[1];
141143
if (value !== undefined) {
142-
(args as any)[name as any] = (typeof value === 'string') ? configurationResolverService.resolve(lastActiveWorkspaceRoot, value) : value;
144+
(args as any)[name as any] = (typeof value === 'string') ? await configurationResolverService.resolveAsync(lastActiveWorkspaceRoot, value) : value;
143145
}
144-
});
146+
}
145147
const existing = editorService.getEditors(EditorsOrder.MOST_RECENTLY_ACTIVE).find(id => id.editor.getTypeId() === SearchEditorInput.ID);
146148
let editor: SearchEditor;
147149
if (existing && args.location === 'reuse') {

src/vs/workbench/contrib/terminal/browser/terminalActions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async function getCwdForSplit(configHelper: ITerminalConfigHelper, instance: ITe
7676
}
7777

7878
export const terminalSendSequenceCommand = (accessor: ServicesAccessor, args: { text?: string } | undefined) => {
79-
accessor.get(ITerminalService).doWithActiveInstance(t => {
79+
accessor.get(ITerminalService).doWithActiveInstance(async t => {
8080
if (!args?.text) {
8181
return;
8282
}
@@ -85,7 +85,7 @@ export const terminalSendSequenceCommand = (accessor: ServicesAccessor, args: {
8585
const historyService = accessor.get(IHistoryService);
8686
const activeWorkspaceRootUri = historyService.getLastActiveWorkspaceRoot(Schemas.file);
8787
const lastActiveWorkspaceRoot = activeWorkspaceRootUri ? withNullAsUndefined(workspaceContextService.getWorkspaceFolder(activeWorkspaceRootUri)) : undefined;
88-
const resolvedText = configurationResolverService.resolve(lastActiveWorkspaceRoot, args.text);
88+
const resolvedText = await configurationResolverService.resolveAsync(lastActiveWorkspaceRoot, args.text);
8989
t.sendText(resolvedText, false);
9090
});
9191
};

src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,16 +376,16 @@ export class TerminalProcessManager extends Disposable implements ITerminalProce
376376
shellLaunchConfig.executable = defaultConfig.shell;
377377
shellLaunchConfig.args = defaultConfig.args;
378378
} else {
379-
shellLaunchConfig.executable = this._configurationResolverService.resolve(lastActiveWorkspace, shellLaunchConfig.executable);
379+
shellLaunchConfig.executable = await this._configurationResolverService.resolveAsync(lastActiveWorkspace, shellLaunchConfig.executable);
380380
if (shellLaunchConfig.args) {
381381
if (Array.isArray(shellLaunchConfig.args)) {
382382
const resolvedArgs: string[] = [];
383383
for (const arg of shellLaunchConfig.args) {
384-
resolvedArgs.push(this._configurationResolverService.resolve(lastActiveWorkspace, arg));
384+
resolvedArgs.push(await this._configurationResolverService.resolveAsync(lastActiveWorkspace, arg));
385385
}
386386
shellLaunchConfig.args = resolvedArgs;
387387
} else {
388-
shellLaunchConfig.args = this._configurationResolverService.resolve(lastActiveWorkspace, shellLaunchConfig.args);
388+
shellLaunchConfig.args = await this._configurationResolverService.resolveAsync(lastActiveWorkspace, shellLaunchConfig.args);
389389
}
390390
}
391391
}

src/vs/workbench/contrib/terminal/node/terminalProfiles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ async function transformToTerminalProfiles(entries: IterableIterator<[string, IT
110110
const paths = originalPaths.slice();
111111

112112
for (let i = 0; i < paths.length; i++) {
113-
paths[i] = variableResolver?.resolve(workspaceFolder, paths[i]) || paths[i];
113+
paths[i] = await variableResolver?.resolveAsync(workspaceFolder, paths[i]) || paths[i];
114114
}
115115
const validatedProfile = await validateProfilePaths(profileName, paths, fsProvider, args, profile.overrideName, profile.isAutoDetected, logService);
116116
if (validatedProfile) {

0 commit comments

Comments
 (0)