Update LSP docs

This commit is contained in:
Laurențiu Nicola
2022-03-04 08:26:44 +02:00
parent 4b16b9b74b
commit b9d74fe2ed
3 changed files with 11 additions and 8 deletions

View File

@@ -233,7 +233,7 @@ pub enum InlayHints {}
impl Request for InlayHints { impl Request for InlayHints {
type Params = InlayHintsParams; type Params = InlayHintsParams;
type Result = Vec<InlayHint>; type Result = Vec<InlayHint>;
const METHOD: &'static str = "rust-analyzer/inlayHints"; const METHOD: &'static str = "experimental/inlayHints";
} }
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]

View File

@@ -1,5 +1,5 @@
<!--- <!---
lsp_ext.rs hash: 5b53b92c9f9d6650 lsp_ext.rs hash: e32fdde032ff6ebc
If you need to change the above hash to make the test pass, please check if you 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: need to adjust this doc as well and ping this issue:
@@ -562,11 +562,11 @@ Expands macro call at a given position.
## Inlay Hints ## Inlay Hints
**Method:** `rust-analyzer/inlayHints` **Method:** `experimental/inlayHints`
This request is sent from client to server to render "inlay hints" -- virtual text inserted into editor to show things like inferred types. This request is sent 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. 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. Until it gets upstreamed, this follows the VS Code API.
Upstream issues: https://github.com/microsoft/language-server-protocol/issues/956 , https://github.com/rust-analyzer/rust-analyzer/issues/2797 Upstream issues: https://github.com/microsoft/language-server-protocol/issues/956 , https://github.com/rust-analyzer/rust-analyzer/issues/2797
**Request:** **Request:**
@@ -581,9 +581,12 @@ interface InlayHintsParams {
```typescript ```typescript
interface InlayHint { interface InlayHint {
kind: "TypeHint" | "ParameterHint" | "ChainingHint", position: Position;
range: Range, label: string | InlayHintLabelPart[];
label: string, tooltip?: string | MarkdownString | undefined;
kind?: InlayHintKind;
paddingLeft?: boolean;
paddingRight?: boolean;
} }
``` ```

View File

@@ -104,7 +104,7 @@ export interface InlayHintsParams {
textDocument: lc.TextDocumentIdentifier; textDocument: lc.TextDocumentIdentifier;
range: lc.Range; range: lc.Range;
} }
export const inlayHints = new lc.RequestType<InlayHintsParams, InlayHint[], void>("rust-analyzer/inlayHints"); export const inlayHints = new lc.RequestType<InlayHintsParams, InlayHint[], void>("experimental/inlayHints");
export interface SsrParams { export interface SsrParams {
query: string; query: string;