about summary refs log tree commit diff
path: root/docs
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2020-05-24 17:01:40 +0200
committerAleksey Kladov <aleksey.kladov@gmail.com>2020-05-24 17:01:40 +0200
commitdec4ba80236e1be15f011fd6b2f7f0ecb151fd31 (patch)
treef218a60dfaa5acb9c2daac08114420531e413739 /docs
parent934227361623b258d833be20e464e1509cb432ad (diff)
downloadrust-dec4ba80236e1be15f011fd6b2f7f0ecb151fd31.tar.gz
rust-dec4ba80236e1be15f011fd6b2f7f0ecb151fd31.zip
Document some rust-analyzer specific protocol extensions
Diffstat (limited to 'docs')
-rw-r--r--docs/dev/lsp-extensions.md62
1 files changed, 62 insertions, 0 deletions
diff --git a/docs/dev/lsp-extensions.md b/docs/dev/lsp-extensions.md
index 9fa1c5fc2e4..55035cfae18 100644
--- a/docs/dev/lsp-extensions.md
+++ b/docs/dev/lsp-extensions.md
@@ -217,3 +217,65 @@ Moreover, it would be cool if editors didn't need to implement even basic langua
 * Should we return a a nested brace structure, to allow paredit-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?
+
+## Analyzer Status
+
+**Method:** `rust-analyzer/analyzerStatus`
+
+**Request:** `null`
+
+**Response:** `string`
+
+Returns internal status message, mostly for debugging purposes.
+
+## Collect Garbage
+
+**Method:** `rust-analyzer/collectGarbage`
+
+**Request:** `null`
+
+**Response:** `null`
+
+Frees some caches. For internal use, and is mostly broken at the moment.
+
+## Syntax Tree
+
+**Method:** `rust-analyzer/syntaxTree`
+
+**Request:**
+
+```typescript
+interface SyntaxTeeParams {
+    textDocument: TextDocumentIdentifier,
+    range?: Range,
+}
+```
+
+**Response:** `string`
+
+Returns textual representation of a parse tree for the file/selected region.
+Primarily for debugging, but very useful for all people working on rust-analyzer itself.
+
+## Expand Macro
+
+**Method:** `rust-analyzer/expandMacro`
+
+**Request:**
+
+```typescript
+interface ExpandMacroParams {
+    textDocument: TextDocumentIdentifier,
+    position?: Position,
+}
+```
+
+**Response:**
+
+```typescript
+interface ExpandedMacro {
+    name: string,
+    expansion: string,
+}
+```
+
+Expands macro call at a given position.