about summary refs log tree commit diff
path: root/docs
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2020-05-27 12:20:47 +0200
committerAleksey Kladov <aleksey.kladov@gmail.com>2020-05-27 12:20:47 +0200
commitbb415c1818fe75badbd70a87a4ae23923a3d3984 (patch)
treeb9e73d7779a920ed6f81c8e00e507300e905bbfe /docs
parentdbb2c153ffad541474f2e5c7c7bd7ea93cf68f5f (diff)
downloadrust-bb415c1818fe75badbd70a87a4ae23923a3d3984.tar.gz
rust-bb415c1818fe75badbd70a87a4ae23923a3d3984.zip
Document inlay hints and runnables
We want to change those, but let's document what we have in meantime
Diffstat (limited to 'docs')
-rw-r--r--docs/dev/lsp-extensions.md63
1 files changed, 63 insertions, 0 deletions
diff --git a/docs/dev/lsp-extensions.md b/docs/dev/lsp-extensions.md
index 209f470eba5..c898f3e93a8 100644
--- a/docs/dev/lsp-extensions.md
+++ b/docs/dev/lsp-extensions.md
@@ -362,3 +362,66 @@ interface ExpandedMacro {
 ```
 
 Expands macro call at a given position.
+
+## Inlay Hints
+
+**Method:** `rust-analyzer/inlayHints`
+
+This request is send from client to server to render "inlay hints" -- virtual text inserted into editor to show things like inferred types.
+Generally, the client should re-query inlay hints after every modification.
+Note that we plan to move this request to `experimental/inlayHints`, as it is not really Rust-specific, but the current API is not necessary the right one.
+Upstream issue: https://github.com/microsoft/language-server-protocol/issues/956
+
+**Request:**
+
+```typescript
+interface InlayHintsParams {
+    textDocument: TextDocumentIdentifier,
+}
+```
+
+**Response:** `InlayHint[]`
+
+```typescript
+interface InlayHint {
+    kind: "TypeHint" | "ParameterHint" | "ChainingHints",
+    range: Range,
+    label: string,
+}
+```
+
+## Runnables
+
+**Method:** `rust-analyzer/runnables`
+
+This request is send from client to server to get the list of things that can be run (tests, binaries, `cargo check -p`).
+Note that we plan to move this request to `experimental/runnables`, as it is not really Rust-specific, but the current API is not necessary the right one.
+Upstream issue: https://github.com/microsoft/language-server-protocol/issues/944
+
+**Request:**
+
+```typescript
+interface RunnablesParams {
+    textDocument: TextDocumentIdentifier;
+    /// If null, compute runnables for the whole file.
+    position?: Position;
+}
+```
+
+**Response:** `Runnable[]`
+
+```typescript
+interface Runnable {
+    /// The range this runnable is applicable for.
+    range: lc.Range;
+    /// The label to show in the UI.
+    label: string;
+    /// The following fields describe a process to spawn.
+    bin: string;
+    args: string[];
+    /// Args for cargo after `--`.
+    extraArgs: string[];
+    env: { [key: string]: string };
+    cwd: string | null;
+}
+```