From 7beb5ea294b2e3a7da56d4390ecb84d402d7f4fc Mon Sep 17 00:00:00 2001 From: Philip Langer Date: Wed, 3 Aug 2022 18:07:01 +0200 Subject: [PATCH] vscode: Make TerminalLink compatible to VSCode 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 #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 #11521 is fixed. Fixes #11507 Contributed on behalf of STMicroelectronics. Change-Id: If183c73b8152770c4c9062355f92143f7e201e53 Signed-off-by: Philip Langer --- packages/plugin/src/theia.d.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/plugin/src/theia.d.ts b/packages/plugin/src/theia.d.ts index 5fccb1e109bf1..28dade262ef30 100644 --- a/packages/plugin/src/theia.d.ts +++ b/packages/plugin/src/theia.d.ts @@ -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]. */ @@ -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); } /**