aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/dev/lsp-extensions.md38
-rw-r--r--editors/code/src/client.ts2
2 files changed, 39 insertions, 1 deletions
diff --git a/docs/dev/lsp-extensions.md b/docs/dev/lsp-extensions.md
index 7f7940d0b..a0847dad3 100644
--- a/docs/dev/lsp-extensions.md
+++ b/docs/dev/lsp-extensions.md
@@ -467,3 +467,41 @@ interface InlayHint {
467 label: string, 467 label: string,
468} 468}
469``` 469```
470
471## Hover Actions
472
473**Client Capability:** `{ "hoverActions": boolean }`
474
475If this capability is set, `Hover` request returned from the server might contain an additional field, `actions`:
476
477```typescript
478interface Hover {
479 ...
480 actions?: CommandLinkGroup[];
481}
482
483interface CommandLink extends Command {
484 /**
485 * A tooltip for the command, when represented in the UI.
486 */
487 tooltip?: string;
488}
489
490interface CommandLinkGroup {
491 title?: string;
492 commands: CommandLink[];
493}
494```
495
496Such actions on the client side are appended to a hover bottom as command links:
497```
498 +-----------------------------+
499 | Hover content |
500 | |
501 +-----------------------------+
502 | _Action1_ | _Action2_ | <- first group, no TITLE
503 +-----------------------------+
504 | TITLE _Action1_ | _Action2_ | <- second group
505 +-----------------------------+
506 ...
507``` \ No newline at end of file
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts
index 9df670283..f2094b5ce 100644
--- a/editors/code/src/client.ts
+++ b/editors/code/src/client.ts
@@ -66,7 +66,7 @@ export function createClient(serverPath: string, cwd: string): lc.LanguageClient
66 // Workaround to support command links (trusted vscode.MarkdownString) in hovers 66 // Workaround to support command links (trusted vscode.MarkdownString) in hovers
67 // https://github.com/microsoft/vscode/issues/33577 67 // https://github.com/microsoft/vscode/issues/33577
68 hover.contents = hover.contents.map(toTrusted); 68 hover.contents = hover.contents.map(toTrusted);
69 69
70 const actions = (<any>result).actions; 70 const actions = (<any>result).actions;
71 if (actions) { 71 if (actions) {
72 hover.contents.push(renderHoverActions(actions)); 72 hover.contents.push(renderHoverActions(actions));