Unnamed repository; edit this file 'description' to name the repository.
| -rw-r--r-- | crates/rust-analyzer/src/handlers/request.rs | 2 | ||||
| -rw-r--r-- | crates/rust-analyzer/src/lsp_ext.rs | 9 | ||||
| -rw-r--r-- | docs/dev/lsp-extensions.md | 14 | ||||
| -rw-r--r-- | editors/code/src/lsp_ext.ts | 6 |
4 files changed, 6 insertions, 25 deletions
diff --git a/crates/rust-analyzer/src/handlers/request.rs b/crates/rust-analyzer/src/handlers/request.rs index b191d8d368..aad74b7466 100644 --- a/crates/rust-analyzer/src/handlers/request.rs +++ b/crates/rust-analyzer/src/handlers/request.rs @@ -1691,7 +1691,7 @@ pub(crate) fn handle_move_item( pub(crate) fn handle_view_recursive_memory_layout( snap: GlobalStateSnapshot, - params: lsp_ext::ViewRecursiveMemoryLayoutParams, + params: lsp_types::TextDocumentPositionParams, ) -> anyhow::Result<Option<lsp_ext::RecursiveMemoryLayout>> { let _p = profile::span("view_recursive_memory_layout"); let file_id = from_proto::file_id(&snap, ¶ms.text_document.uri)?; diff --git a/crates/rust-analyzer/src/lsp_ext.rs b/crates/rust-analyzer/src/lsp_ext.rs index 39b8e84028..d0989b3230 100644 --- a/crates/rust-analyzer/src/lsp_ext.rs +++ b/crates/rust-analyzer/src/lsp_ext.rs @@ -185,20 +185,13 @@ pub struct ExpandedMacro { pub enum ViewRecursiveMemoryLayout {} impl Request for ViewRecursiveMemoryLayout { - type Params = ViewRecursiveMemoryLayoutParams; + type Params = lsp_types::TextDocumentPositionParams; type Result = Option<RecursiveMemoryLayout>; const METHOD: &'static str = "rust-analyzer/viewRecursiveMemoryLayout"; } #[derive(Deserialize, Serialize, Debug)] #[serde(rename_all = "camelCase")] -pub struct ViewRecursiveMemoryLayoutParams { - pub text_document: TextDocumentIdentifier, - pub position: Position, -} - -#[derive(Deserialize, Serialize, Debug)] -#[serde(rename_all = "camelCase")] pub struct RecursiveMemoryLayout { pub nodes: Vec<MemoryLayoutNode>, } diff --git a/docs/dev/lsp-extensions.md b/docs/dev/lsp-extensions.md index 8655e95467..024acb8770 100644 --- a/docs/dev/lsp-extensions.md +++ b/docs/dev/lsp-extensions.md @@ -1,5 +1,5 @@ <!--- -lsp_ext.rs hash: 12bf360ee77cc63d +lsp_ext.rs hash: 149a5be3c5e469d1 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: @@ -889,17 +889,9 @@ Returns all crates from this workspace, so it can be used create a viewTree to h ## View Recursive Memory Layout -**Method:** `rust-analyzer/fetchDependencyList` - -**Request:** +**Method:** `rust-analyzer/viewRecursiveMemoryLayout` -```typescript -/// Holds a location in a text document, the location may be a datatype or a variable and it will do its best to locate the desired type. -export interface ViewRecursiveMemoryLayoutParams { - textDocument: TextDocumentIdentifier; - position: Position; -} -``` +**Request:** `TextDocumentPositionParams` **Response:** diff --git a/editors/code/src/lsp_ext.ts b/editors/code/src/lsp_ext.ts index 9ab1a99376..5af2cab0ee 100644 --- a/editors/code/src/lsp_ext.ts +++ b/editors/code/src/lsp_ext.ts @@ -151,7 +151,7 @@ export const serverStatus = new lc.NotificationType<ServerStatusParams>( ); export const ssr = new lc.RequestType<SsrParams, lc.WorkspaceEdit, void>("experimental/ssr"); export const viewRecursiveMemoryLayout = new lc.RequestType< - ViewRecursiveMemoryLayoutParams, + lc.TextDocumentPositionParams, RecursiveMemoryLayout | null, void >("rust-analyzer/viewRecursiveMemoryLayout"); @@ -203,10 +203,6 @@ export type SsrParams = { selections: readonly lc.Range[]; }; -export type ViewRecursiveMemoryLayoutParams = { - textDocument: lc.TextDocumentIdentifier; - position: lc.Position; -}; export type RecursiveMemoryLayoutNode = { item_name: string; typename: string; |