Clean up profile provider api

This commit is contained in:
Daniel Imms 2021-05-27 15:27:38 -07:00
parent e8758933d8
commit 9b609ab1e1
4 changed files with 3 additions and 18 deletions

View file

@ -569,11 +569,6 @@ export interface ITerminalProfile {
icon?: ThemeIcon | URI | { light: URI, dark: URI };
}
export interface ITerminalContributedProfile {
id: string;
icon?: string;
}
export interface ITerminalDimensionsOverride extends Readonly<ITerminalDimensions> {
/**
* indicate that xterm must receive these exact dimensions, even if they overflow the ui!

View file

@ -921,14 +921,16 @@ declare module 'vscode' {
export namespace window {
/**
* Registers a provider for a contributed terminal profile.
* @param id The ID of the contributed terminal profile.
* @param provider The terminal profile provider.
*/
export function registerTerminalProfileProvider(id: string, provider: TerminalProfileProvider): Disposable;
// TODO: id -> profileId, profileType?
}
export interface TerminalProfileProvider {
/**
* Provide terminal profile options for the requested terminal.
* @param token A cancellation token that indicates the result is no longer needed.
*/
provideProfileOptions(token: CancellationToken): ProviderResult<TerminalOptions | ExtensionTerminalOptions>;
}

View file

@ -585,7 +585,6 @@ export abstract class BaseExtHostTerminalService extends Disposable implements I
}
public registerProfileProvider(id: string, provider: vscode.TerminalProfileProvider): vscode.Disposable {
console.log('registerProfileProvider', id);
if (this._profileProviders.has(id)) {
throw new Error(`Terminal profile provider "${id}" already registered`);
}
@ -607,12 +606,8 @@ export abstract class BaseExtHostTerminalService extends Disposable implements I
throw new Error(`No terminal profile options provided for id "${id}"`);
}
if ('pty' in options) {
// TODO: Pass in split terminal option
this.createExtensionTerminal(options, { isSplitTerminal });
}
// if (options.iconPath) {
// checkProposedApiEnabled(extension);
// }
this.createTerminalFromOptions(options, { isSplitTerminal });
}

View file

@ -984,13 +984,6 @@ export class TerminalService implements ITerminalService {
if ('id' in value.profile) {
await this.createContributedTerminalProfile(value.profile.id, !!(keyMods?.alt && activeInstance));
// TODO: Pass in cwd here? cwd should probably still be inherited
// if (keyMods?.alt && activeInstance) {
// // create split, only valid if there's an active instance
// instance = this.splitInstance(activeInstance, slc);
// } else {
// instance = this.createTerminal(slc);
// }
return;
} else {
if (keyMods?.alt && activeInstance) {