Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vscode - proposed API evolution for TerminalQuickFixProvider for 1.82.0 #13006

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
## v1.43.0 - Unreleased

- [vsode] evolve proposed API for dropDocument [#13009](https://github.com/eclipse-theia/theia/pull/13009) - contributed on behalf of STMicroelectronics
- [vsode] evolve proposed API for terminalQuickFixProvider [#13006](https://github.com/eclipse-theia/theia/pull/13006) - contributed on behalf of STMicroelectronics

<a name="breaking_changes_1.43.0">[Breaking Changes:](#breaking_changes_1.43.0)</a>

Expand Down
8 changes: 5 additions & 3 deletions packages/plugin-ext/src/plugin/plugin-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ import {
TerminalLocation,
TerminalExitReason,
TerminalProfile,
TerminalQuickFixType,
InlayHint,
InlayHintKind,
InlayHintLabelPart,
Expand Down Expand Up @@ -199,7 +198,9 @@ import {
DocumentPasteEdit,
ExternalUriOpenerPriority,
EditSessionIdentityMatch,
TerminalOutputAnchor
TerminalOutputAnchor,
TerminalQuickFixExecuteTerminalCommand,
TerminalQuickFixOpener
} from './types-impl';
import { AuthenticationExtImpl } from './authentication-ext';
import { SymbolKind } from '../common/plugin-api-rpc-model';
Expand Down Expand Up @@ -1391,7 +1392,8 @@ export function createAPIFactory(
TerminalExitReason,
DocumentPasteEdit,
ExternalUriOpenerPriority,
TerminalQuickFixType,
TerminalQuickFixExecuteTerminalCommand,
TerminalQuickFixOpener,
EditSessionIdentityMatch
};
};
Expand Down
29 changes: 24 additions & 5 deletions packages/plugin-ext/src/plugin/types-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2183,11 +2183,6 @@ export enum TerminalExitReason {
Extension = 4,
}

export enum TerminalQuickFixType {
command = 'command',
opener = 'opener'
}

@es5ClassCompat
export class FileDecoration {

Expand Down Expand Up @@ -3630,3 +3625,27 @@ export enum EditSessionIdentityMatch {
None = 0
}
// #endregion

// #region terminalQuickFixProvider
export class TerminalQuickFixExecuteTerminalCommand {
/**
* The terminal command to run
*/
terminalCommand: string;
/**
* @stubbed
*/
constructor(terminalCommand: string) { }
}
export class TerminalQuickFixOpener {
/**
* The uri to open
*/
uri: theia.Uri;
/**
* @stubbed
*/
constructor(uri: theia.Uri) { }
}

// #endregion
23 changes: 16 additions & 7 deletions packages/plugin/src/theia.proposed.terminalQuickFixProvider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

export module '@theia/plugin' {

export type SingleOrMany<T> = T[] | T;

export namespace window {
/**
* @param provider A terminal quick fix provider
Expand All @@ -37,7 +39,8 @@ export module '@theia/plugin' {
* @param token A cancellation token indicating the result is no longer needed
* @return Terminal quick fix(es) if any
*/
provideTerminalQuickFixes(commandMatchResult: TerminalCommandMatchResult, token: CancellationToken): TerminalQuickFix[] | TerminalQuickFix | undefined;
provideTerminalQuickFixes(commandMatchResult: TerminalCommandMatchResult, token: CancellationToken):
ProviderResult<SingleOrMany<TerminalQuickFixExecuteTerminalCommand | TerminalQuickFixOpener | Command>>;
}

export interface TerminalCommandMatchResult {
Expand All @@ -49,13 +52,19 @@ export module '@theia/plugin' {
};
}

interface TerminalQuickFix {
type: TerminalQuickFixType;
export class TerminalQuickFixExecuteTerminalCommand {
/**
* The terminal command to run
*/
terminalCommand: string;
constructor(terminalCommand: string);
}

enum TerminalQuickFixType {
command = 'command',
opener = 'opener'
export class TerminalQuickFixOpener {
/**
* The uri to open
*/
uri: Uri;
constructor(uri: Uri);
}

/**
Expand Down