未验证 提交 d02a4aac 编写于 作者: D Daniel Imms

Remove quick launch terminology from code

Fixes #119815
上级 7208128b
......@@ -355,7 +355,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
private async _onRequestAvailableProfiles(req: IAvailableProfilesRequest): Promise<void> {
if (this._isPrimaryExtHost() && this._extHostKind !== ExtensionHostKind.LocalWebWorker) {
req.callback(await this._proxy.$getAvailableProfiles(req.quickLaunchOnly));
req.callback(await this._proxy.$getAvailableProfiles(req.configuredProfilesOnly));
}
}
......
......@@ -1657,8 +1657,7 @@ export interface ExtHostTerminalServiceShape {
$acceptProcessRequestCwd(id: number): void;
$acceptProcessRequestLatency(id: number): number;
$acceptWorkspacePermissionsChanged(isAllowed: boolean): void;
// TODO: Change quickLaunchOnly to "includeAutoDetected" or something similar
$getAvailableProfiles(quickLaunchOnly: boolean): Promise<ITerminalProfile[]>;
$getAvailableProfiles(configuredProfilesOnly: boolean): Promise<ITerminalProfile[]>;
$getDefaultShellAndArgs(useAutomationShell: boolean): Promise<IShellAndArgsDto>;
$provideLinks(id: number, line: string): Promise<ITerminalLinkDto[]>;
$activateLink(id: number, linkId: number): void;
......
......@@ -328,7 +328,7 @@ export abstract class BaseExtHostTerminalService extends Disposable implements I
public abstract createTerminalFromOptions(options: vscode.TerminalOptions): vscode.Terminal;
public abstract getDefaultShell(useAutomationShell: boolean, configProvider: ExtHostConfigProvider): string;
public abstract getDefaultShellArgs(useAutomationShell: boolean, configProvider: ExtHostConfigProvider): string[] | string;
public abstract $getAvailableProfiles(quickLaunchOnly: boolean): Promise<ITerminalProfile[]>;
public abstract $getAvailableProfiles(configuredProfilesOnly: boolean): Promise<ITerminalProfile[]>;
public abstract $getDefaultShellAndArgs(useAutomationShell: boolean): Promise<IShellAndArgsDto>;
public abstract $acceptWorkspacePermissionsChanged(isAllowed: boolean): void;
......@@ -779,7 +779,7 @@ export class WorkerExtHostTerminalService extends BaseExtHostTerminalService {
throw new NotSupportedError();
}
public $getAvailableProfiles(quickLaunchOnly: boolean): Promise<ITerminalProfile[]> {
public $getAvailableProfiles(configuredProfilesOnly: boolean): Promise<ITerminalProfile[]> {
throw new NotSupportedError();
}
......
......@@ -136,9 +136,9 @@ export class ExtHostTerminalService extends BaseExtHostTerminalService {
return this._variableResolver;
}
public async $getAvailableProfiles(quickLaunchOnly: boolean): Promise<ITerminalProfile[]> {
public async $getAvailableProfiles(configuredProfilesOnly: boolean): Promise<ITerminalProfile[]> {
const config = await (await this._extHostConfiguration.getConfigProvider()).getConfiguration().get('terminal.integrated');
return detectAvailableProfiles(quickLaunchOnly, this._logService, config as ITerminalConfiguration, await this._variableResolverPromise, this._lastActiveWorkspace);
return detectAvailableProfiles(configuredProfilesOnly, this._logService, config as ITerminalConfiguration, await this._variableResolverPromise, this._lastActiveWorkspace);
}
public async $getDefaultShellAndArgs(useAutomationShell: boolean): Promise<IShellAndArgsDto> {
......
......@@ -361,14 +361,14 @@ export class TerminalService implements ITerminalService {
return this._updateAvailableProfilesNow();
}
private async _detectProfiles(quickLaunchOnly: boolean): Promise<ITerminalProfile[]> {
private async _detectProfiles(configuredProfilesOnly: boolean): Promise<ITerminalProfile[]> {
await this._extensionService.whenInstalledExtensionsRegistered();
// Wait for the remoteAuthority to be ready (and listening for events) before firing
// the event to spawn the ext host process
const conn = this._remoteAgentService.getConnection();
const remoteAuthority = conn ? conn.remoteAuthority : 'null';
await this._whenExtHostReady(remoteAuthority);
return new Promise(r => this._onRequestAvailableProfiles.fire({ callback: r, quickLaunchOnly: quickLaunchOnly }));
return new Promise(r => this._onRequestAvailableProfiles.fire({ callback: r, configuredProfilesOnly: configuredProfilesOnly }));
}
private async _whenExtHostReady(remoteAuthority: string): Promise<void> {
......
......@@ -262,7 +262,7 @@ export type ITerminalProfileObject = ITerminalExecutable | ITerminalProfileSourc
export interface IAvailableProfilesRequest {
callback: (shells: ITerminalProfile[]) => void;
quickLaunchOnly: boolean;
configuredProfilesOnly: boolean;
}
export interface IDefaultShellAndArgsRequest {
useAutomationShell: boolean;
......
......@@ -17,11 +17,11 @@ import * as pfs from 'vs/base/node/pfs';
let profileSources: Map<string, IPotentialTerminalProfile> | undefined;
export function detectAvailableProfiles(quickLaunchOnly: boolean, logService?: ILogService, config?: ITerminalConfiguration, variableResolver?: ExtHostVariableResolverService, workspaceFolder?: IWorkspaceFolder, statProvider?: IStatProvider, testPaths?: string[]): Promise<ITerminalProfile[]> {
return platform.isWindows ? detectAvailableWindowsProfiles(quickLaunchOnly, statProvider, logService, config?.displayDetectedWslProfiles, config?.profiles.windows, variableResolver, workspaceFolder) : detectAvailableUnixProfiles(statProvider, logService, quickLaunchOnly, platform.isMacintosh ? config?.profiles.osx : config?.profiles.linux, testPaths, variableResolver, workspaceFolder);
export function detectAvailableProfiles(configuredProfilesOnly: boolean, logService?: ILogService, config?: ITerminalConfiguration, variableResolver?: ExtHostVariableResolverService, workspaceFolder?: IWorkspaceFolder, statProvider?: IStatProvider, testPaths?: string[]): Promise<ITerminalProfile[]> {
return platform.isWindows ? detectAvailableWindowsProfiles(configuredProfilesOnly, statProvider, logService, config?.displayDetectedWslProfiles, config?.profiles.windows, variableResolver, workspaceFolder) : detectAvailableUnixProfiles(statProvider, logService, configuredProfilesOnly, platform.isMacintosh ? config?.profiles.osx : config?.profiles.linux, testPaths, variableResolver, workspaceFolder);
}
async function detectAvailableWindowsProfiles(quickLaunchOnly: boolean, statProvider?: IStatProvider, logService?: ILogService, displayDetectedWslProfiles?: boolean, configProfiles?: { [key: string]: ITerminalProfileObject }, variableResolver?: ExtHostVariableResolverService, workspaceFolder?: IWorkspaceFolder): Promise<ITerminalProfile[]> {
async function detectAvailableWindowsProfiles(configuredProfilesOnly: boolean, statProvider?: IStatProvider, logService?: ILogService, displayDetectedWslProfiles?: boolean, configProfiles?: { [key: string]: ITerminalProfileObject }, variableResolver?: ExtHostVariableResolverService, workspaceFolder?: IWorkspaceFolder): Promise<ITerminalProfile[]> {
// Determine the correct System32 path. We want to point to Sysnative
// when the 32-bit version of VS Code is running on a 64-bit machine.
// The reason for this is because PowerShell's important PSReadline
......@@ -40,7 +40,7 @@ async function detectAvailableWindowsProfiles(quickLaunchOnly: boolean, statProv
const detectedProfiles: Map<string, ITerminalProfileObject> = new Map();
// Add auto detected profiles
if (!quickLaunchOnly) {
if (!configuredProfilesOnly) {
detectedProfiles.set('PowerShell', { source: ProfileSource.Pwsh, isAutoDetected: true });
detectedProfiles.set('Git Bash', { source: ProfileSource.GitBash, isAutoDetected: true });
detectedProfiles.set('Cygwin', {
......@@ -63,7 +63,7 @@ async function detectAvailableWindowsProfiles(quickLaunchOnly: boolean, statProv
const resultProfiles: ITerminalProfile[] = await transformToTerminalProfiles(detectedProfiles.entries(), logService, statProvider, variableResolver, workspaceFolder);
if (!quickLaunchOnly || (quickLaunchOnly && displayDetectedWslProfiles)) {
if (!configuredProfilesOnly || (configuredProfilesOnly && displayDetectedWslProfiles)) {
resultProfiles.push(... await getWslProfiles(`${system32Path}\\${useWSLexe ? 'wsl.exe' : 'bash.exe'}`, displayDetectedWslProfiles));
}
......@@ -190,11 +190,11 @@ async function getWslProfiles(wslPath: string, displayDetectedWslProfiles?: bool
return [];
}
async function detectAvailableUnixProfiles(statProvider?: IStatProvider, logService?: ILogService, quickLaunchOnly?: boolean, configProfiles?: { [key: string]: ITerminalProfileObject }, testPaths?: string[], variableResolver?: ExtHostVariableResolverService, workspaceFolder?: IWorkspaceFolder): Promise<ITerminalProfile[]> {
async function detectAvailableUnixProfiles(statProvider?: IStatProvider, logService?: ILogService, configuredProfilesOnly?: boolean, configProfiles?: { [key: string]: ITerminalProfileObject }, testPaths?: string[], variableResolver?: ExtHostVariableResolverService, workspaceFolder?: IWorkspaceFolder): Promise<ITerminalProfile[]> {
const detectedProfiles: Map<string, ITerminalProfileObject> = new Map();
// Add non-quick launch profiles
if (!quickLaunchOnly) {
if (!configuredProfilesOnly) {
const contents = await fs.promises.readFile('/etc/shells', 'utf8');
const profiles = testPaths || contents.split('\n').filter(e => e.trim().indexOf('#') !== 0 && e.trim().length > 0);
const counts: Map<string, number> = new Map();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册