Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--crates/rust-analyzer/src/lsp_ext.rs2
-rw-r--r--docs/dev/lsp-extensions.md15
-rw-r--r--editors/code/src/lsp_ext.ts2
3 files changed, 11 insertions, 8 deletions
diff --git a/crates/rust-analyzer/src/lsp_ext.rs b/crates/rust-analyzer/src/lsp_ext.rs
index 973769a720..846f151304 100644
--- a/crates/rust-analyzer/src/lsp_ext.rs
+++ b/crates/rust-analyzer/src/lsp_ext.rs
@@ -233,7 +233,7 @@ pub enum InlayHints {}
impl Request for InlayHints {
type Params = InlayHintsParams;
type Result = Vec<InlayHint>;
- const METHOD: &'static str = "rust-analyzer/inlayHints";
+ const METHOD: &'static str = "experimental/inlayHints";
}
#[derive(Serialize, Deserialize, Debug)]
diff --git a/docs/dev/lsp-extensions.md b/docs/dev/lsp-extensions.md
index 85df1188a8..9f1c7fe0a3 100644
--- a/docs/dev/lsp-extensions.md
+++ b/docs/dev/lsp-extensions.md
@@ -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
need to adjust this doc as well and ping this issue:
@@ -562,11 +562,11 @@ Expands macro call at a given position.
## 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.
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
**Request:**
@@ -581,9 +581,12 @@ interface InlayHintsParams {
```typescript
interface InlayHint {
- kind: "TypeHint" | "ParameterHint" | "ChainingHint",
- range: Range,
- label: string,
+ position: Position;
+ label: string | InlayHintLabelPart[];
+ tooltip?: string | MarkdownString | undefined;
+ kind?: InlayHintKind;
+ paddingLeft?: boolean;
+ paddingRight?: boolean;
}
```
diff --git a/editors/code/src/lsp_ext.ts b/editors/code/src/lsp_ext.ts
index bdb6a4ca16..9493a03481 100644
--- a/editors/code/src/lsp_ext.ts
+++ b/editors/code/src/lsp_ext.ts
@@ -104,7 +104,7 @@ export interface InlayHintsParams {
textDocument: lc.TextDocumentIdentifier;
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 {
query: string;