Skip to content

Commit 295bbfc

Browse files
committed
API evolution for TerminalQuickFixProvider
note the API is still stubbed in the tool. Fixes #12969 Contributed on behalf of STMicroelectronics Signed-off-by: Remi Schnekenburger <[email protected]>
1 parent 30d166e commit 295bbfc

File tree

4 files changed

+47
-15
lines changed

4 files changed

+47
-15
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
## v1.43.0 - Unreleased
88

9+
- [vsode] evolve proposed API for terminalQuickFixProvider [#13006](https://github.com/eclipse-theia/theia/pull/13006) - contributed on behalf of STMicroelectronics
10+
911
<a name="breaking_changes_1.43.0">[Breaking Changes:](#breaking_changes_1.43.0)</a>
1012

1113
- [core] removed `SETTINGS_OPEN` menupath constant - replaced by `MANAGE_GENERAL` [#12803](https://github.com/eclipse-theia/theia/pull/12803)

packages/plugin-ext/src/plugin/plugin-context.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ import {
161161
TerminalLocation,
162162
TerminalExitReason,
163163
TerminalProfile,
164-
TerminalQuickFixType,
165164
InlayHint,
166165
InlayHintKind,
167166
InlayHintLabelPart,
@@ -199,7 +198,9 @@ import {
199198
DocumentPasteEdit,
200199
ExternalUriOpenerPriority,
201200
EditSessionIdentityMatch,
202-
TerminalOutputAnchor
201+
TerminalOutputAnchor,
202+
TerminalQuickFixExecuteTerminalCommand,
203+
TerminalQuickFixOpener
203204
} from './types-impl';
204205
import { AuthenticationExtImpl } from './authentication-ext';
205206
import { SymbolKind } from '../common/plugin-api-rpc-model';
@@ -1391,7 +1392,8 @@ export function createAPIFactory(
13911392
TerminalExitReason,
13921393
DocumentPasteEdit,
13931394
ExternalUriOpenerPriority,
1394-
TerminalQuickFixType,
1395+
TerminalQuickFixExecuteTerminalCommand,
1396+
TerminalQuickFixOpener,
13951397
EditSessionIdentityMatch
13961398
};
13971399
};

packages/plugin-ext/src/plugin/types-impl.ts

+24-5
Original file line numberDiff line numberDiff line change
@@ -2183,11 +2183,6 @@ export enum TerminalExitReason {
21832183
Extension = 4,
21842184
}
21852185

2186-
export enum TerminalQuickFixType {
2187-
command = 'command',
2188-
opener = 'opener'
2189-
}
2190-
21912186
@es5ClassCompat
21922187
export class FileDecoration {
21932188

@@ -3630,3 +3625,27 @@ export enum EditSessionIdentityMatch {
36303625
None = 0
36313626
}
36323627
// #endregion
3628+
3629+
// #region terminalQuickFixProvider
3630+
export class TerminalQuickFixExecuteTerminalCommand {
3631+
/**
3632+
* The terminal command to run
3633+
*/
3634+
terminalCommand: string;
3635+
/**
3636+
* @stubbed
3637+
*/
3638+
constructor(terminalCommand: string) { }
3639+
}
3640+
export class TerminalQuickFixOpener {
3641+
/**
3642+
* The uri to open
3643+
*/
3644+
uri: theia.Uri;
3645+
/**
3646+
* @stubbed
3647+
*/
3648+
constructor(uri: theia.Uri) { }
3649+
}
3650+
3651+
// #endregion

packages/plugin/src/theia.proposed.terminalQuickFixProvider.d.ts

+16-7
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
export module '@theia/plugin' {
2424

25+
export type SingleOrMany<T> = T[] | T;
26+
2527
export namespace window {
2628
/**
2729
* @param provider A terminal quick fix provider
@@ -37,7 +39,8 @@ export module '@theia/plugin' {
3739
* @param token A cancellation token indicating the result is no longer needed
3840
* @return Terminal quick fix(es) if any
3941
*/
40-
provideTerminalQuickFixes(commandMatchResult: TerminalCommandMatchResult, token: CancellationToken): TerminalQuickFix[] | TerminalQuickFix | undefined;
42+
provideTerminalQuickFixes(commandMatchResult: TerminalCommandMatchResult, token: CancellationToken):
43+
ProviderResult<SingleOrMany<TerminalQuickFixExecuteTerminalCommand | TerminalQuickFixOpener | Command>>;
4144
}
4245

4346
export interface TerminalCommandMatchResult {
@@ -49,13 +52,19 @@ export module '@theia/plugin' {
4952
};
5053
}
5154

52-
interface TerminalQuickFix {
53-
type: TerminalQuickFixType;
55+
export class TerminalQuickFixExecuteTerminalCommand {
56+
/**
57+
* The terminal command to run
58+
*/
59+
terminalCommand: string;
60+
constructor(terminalCommand: string);
5461
}
55-
56-
enum TerminalQuickFixType {
57-
command = 'command',
58-
opener = 'opener'
62+
export class TerminalQuickFixOpener {
63+
/**
64+
* The uri to open
65+
*/
66+
uri: Uri;
67+
constructor(uri: Uri);
5968
}
6069

6170
/**

0 commit comments

Comments
 (0)