mirror of
https://github.com/Microsoft/vscode
synced 2024-09-18 01:58:27 +00:00
Clean up profile provider api
This commit is contained in:
parent
e8758933d8
commit
9b609ab1e1
|
@ -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!
|
||||
|
|
4
src/vs/vscode.proposed.d.ts
vendored
4
src/vs/vscode.proposed.d.ts
vendored
|
@ -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>;
|
||||
}
|
||||
|
|
|
@ -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 });
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue