diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-05-27 10:21:31 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-27 10:21:31 +0000 |
| commit | 54bbbcf7226d946fe90f9dcabbb529ce1476bdf3 (patch) | |
| tree | d5d4bc690c503c5f31118b1136d0437a30385265 /docs/dev | |
| parent | 64a1c77ab279a2baddab25ae86698ece2bc146da (diff) | |
| parent | bb415c1818fe75badbd70a87a4ae23923a3d3984 (diff) | |
| download | rust-54bbbcf7226d946fe90f9dcabbb529ce1476bdf3.tar.gz rust-54bbbcf7226d946fe90f9dcabbb529ce1476bdf3.zip | |
Merge #4632
4632: Document inlay hints and runnables r=matklad a=matklad We want to change those, but let's document what we have in meantime bors r+ 🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Diffstat (limited to 'docs/dev')
| -rw-r--r-- | docs/dev/lsp-extensions.md | 63 |
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; +} +``` |
