about summary refs log tree commit diff
path: root/docs/dev
diff options
context:
space:
mode:
authorvsrs <vit@conrlab.com>2020-06-03 14:34:11 +0300
committervsrs <vit@conrlab.com>2020-06-05 15:00:28 +0300
commitda7ec4b3398ffaf672a755bf57066e17ac42303a (patch)
tree2f8e1d37b13d16262587b6712a4612c6c4261355 /docs/dev
parent7d0dd17b09240385333805637ea17992a8089cf2 (diff)
downloadrust-da7ec4b3398ffaf672a755bf57066e17ac42303a.tar.gz
rust-da7ec4b3398ffaf672a755bf57066e17ac42303a.zip
Add hover actions LSP extension documentation.
Diffstat (limited to 'docs/dev')
-rw-r--r--docs/dev/lsp-extensions.md38
1 files changed, 38 insertions, 0 deletions
diff --git a/docs/dev/lsp-extensions.md b/docs/dev/lsp-extensions.md
index 7f7940d0b6a..a0847dad3a8 100644
--- a/docs/dev/lsp-extensions.md
+++ b/docs/dev/lsp-extensions.md
@@ -467,3 +467,41 @@ interface InlayHint {
     label: string,
 }
 ```
+
+## Hover Actions
+
+**Client Capability:** `{ "hoverActions": boolean }`
+
+If this capability is set, `Hover` request returned from the server might contain an additional field, `actions`:
+
+```typescript
+interface Hover {
+    ...
+    actions?: CommandLinkGroup[];
+}
+
+interface CommandLink extends Command {
+    /**
+     * A tooltip for the command, when represented in the UI.
+     */
+    tooltip?: string;
+}
+
+interface CommandLinkGroup {
+    title?: string;
+    commands: CommandLink[];
+}
+```
+
+Such actions on the client side are appended to a hover bottom as command links:
+```
+  +-----------------------------+
+  | Hover content               |
+  |                             |
+  +-----------------------------+
+  | _Action1_ | _Action2_       |  <- first group, no TITLE
+  +-----------------------------+
+  | TITLE _Action1_ | _Action2_ |  <- second group
+  +-----------------------------+
+  ...
+```
\ No newline at end of file