Skip to content

Commit

Permalink
vscode: Make TerminalLink compatible to VSCode
Browse files Browse the repository at this point in the history
Replaces the out-dated definition of the TerminalLink interface with the current class that also provides a constructor.

In the course of fixing this, I discovered eclipse-theia#11521.
So it looks like Theia doesn't support registering TerminalLinkProvider
at the moment. Anyway, making TerminalLink compatible to VS Code
will help anyway, but only really gets effective once eclipse-theia#11521 is fixed.

Fixes eclipse-theia#11507
Contributed on behalf of STMicroelectronics.

Change-Id: If183c73b8152770c4c9062355f92143f7e201e53
Signed-off-by: Philip Langer <planger@eclipsesource.com>
  • Loading branch information
planger committed Aug 3, 2022
1 parent 7e177f9 commit 7beb5ea
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/plugin/src/theia.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3097,7 +3097,7 @@ export module '@theia/plugin' {
/**
* A link on a terminal line.
*/
export interface TerminalLink {
export class TerminalLink {
/**
* The start index of the link on [TerminalLinkContext.line](#TerminalLinkContext.line].
*/
Expand All @@ -3116,6 +3116,18 @@ export module '@theia/plugin' {
* depending on OS, user settings, and localization.
*/
tooltip?: string;

/**
* Creates a new terminal link.
* @param startIndex The start index of the link on [TerminalLinkContext.line](#TerminalLinkContext.line].
* @param length The length of the link on [TerminalLinkContext.line](#TerminalLinkContext.line].
* @param tooltip The tooltip text when you hover over this link.
*
* If a tooltip is provided, is will be displayed in a string that includes instructions on
* how to trigger the link, such as `{0} (ctrl + click)`. The specific instructions vary
* depending on OS, user settings, and localization.
*/
constructor(startIndex: number, length: number, tooltip?: string);
}

/**
Expand Down

0 comments on commit 7beb5ea

Please sign in to comment.