diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /src/tools/rust-analyzer/docs/dev | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/rust-analyzer/docs/dev')
-rw-r--r-- | src/tools/rust-analyzer/docs/dev/lsp-extensions.md | 69 |
1 files changed, 63 insertions, 6 deletions
diff --git a/src/tools/rust-analyzer/docs/dev/lsp-extensions.md b/src/tools/rust-analyzer/docs/dev/lsp-extensions.md index de1422032..bc58aa722 100644 --- a/src/tools/rust-analyzer/docs/dev/lsp-extensions.md +++ b/src/tools/rust-analyzer/docs/dev/lsp-extensions.md @@ -1,5 +1,5 @@ <!--- -lsp_ext.rs hash: 37f31ae648632897 +lsp_ext.rs hash: 2d60bbffe70ae198 If you need to change the above hash to make the test pass, please check if you need to adjust this doc as well and ping this issue: @@ -333,7 +333,7 @@ Moreover, it would be cool if editors didn't need to implement even basic langua ### Unresolved Question -* Should we return a nested brace structure, to allow paredit-like actions of jump *out* of the current brace pair? +* Should we return a nested brace structure, to allow [paredit](https://paredit.org/)-like actions of jump *out* of the current brace pair? This is how `SelectionRange` request works. * Alternatively, should we perhaps flag certain `SelectionRange`s as being brace pairs? @@ -386,14 +386,26 @@ rust-analyzer supports only one `kind`, `"cargo"`. The `args` for `"cargo"` look ## Open External Documentation -This request is sent from client to server to get a URL to documentation for the symbol under the cursor, if available. +This request is sent from the client to the server to obtain web and local URL(s) for documentation related to the symbol under the cursor, if available. -**Method** `experimental/externalDocs` +**Method:** `experimental/externalDocs` -**Request:**: `TextDocumentPositionParams` +**Request:** `TextDocumentPositionParams` + +**Response:** `string | null` -**Response** `string | null` +## Local Documentation +**Experimental Client Capability:** `{ "localDocs": boolean }` + +If this capability is set, the `Open External Documentation` request returned from the server will have the following structure: + +```typescript +interface ExternalDocsResponse { + web?: string; + local?: string; +} +``` ## Analyzer Status @@ -422,6 +434,16 @@ Returns internal status message, mostly for debugging purposes. Reloads project information (that is, re-executes `cargo metadata`). +## Rebuild proc-macros + +**Method:** `rust-analyzer/rebuildProcMacros` + +**Request:** `null` + +**Response:** `null` + +Rebuilds build scripts and proc-macros, and runs the build scripts to reseed the build data. + ## Server Status **Experimental Client Capability:** `{ "serverStatusNotification": boolean }` @@ -538,6 +560,18 @@ For debugging or when working on rust-analyzer itself. Returns a textual representation of the MIR of the function containing the cursor. For debugging or when working on rust-analyzer itself. +## Interpret Function + +**Method:** `rust-analyzer/interpretFunction` + +**Request:** `TextDocumentPositionParams` + +**Response:** `string` + +Tries to evaluate the function using internal rust analyzer knowledge, without compiling +the code. Currently evaluates the function under cursor, but will give a runnable in +future. Highly experimental. + ## View File Text **Method:** `rust-analyzer/viewFileText` @@ -829,3 +863,26 @@ export interface Diagnostic { rendered?: string; }; } +``` + +## Dependency Tree + +**Method:** `rust-analyzer/fetchDependencyList` + +**Request:** + +```typescript +export interface FetchDependencyListParams {} +``` + +**Response:** +```typescript +export interface FetchDependencyListResult { + crates: { + name: string; + version: string; + path: string; + }[]; +} +``` +Returns all crates from this workspace, so it can be used create a viewTree to help navigate the dependency tree. |