Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 1dd54eb

Browse files
committed
change viewMemoryLayoutParams to be textPositionParams
1 parent 514bab5 commit 1dd54eb

File tree

4 files changed

+6
-25
lines changed

4 files changed

+6
-25
lines changed

crates/rust-analyzer/src/handlers/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1691,7 +1691,7 @@ pub(crate) fn handle_move_item(
16911691

16921692
pub(crate) fn handle_view_recursive_memory_layout(
16931693
snap: GlobalStateSnapshot,
1694-
params: lsp_ext::ViewRecursiveMemoryLayoutParams,
1694+
params: lsp_types::TextDocumentPositionParams,
16951695
) -> anyhow::Result<Option<lsp_ext::RecursiveMemoryLayout>> {
16961696
let _p = profile::span("view_recursive_memory_layout");
16971697
let file_id = from_proto::file_id(&snap, &params.text_document.uri)?;

crates/rust-analyzer/src/lsp_ext.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,18 +185,11 @@ pub struct ExpandedMacro {
185185
pub enum ViewRecursiveMemoryLayout {}
186186

187187
impl Request for ViewRecursiveMemoryLayout {
188-
type Params = ViewRecursiveMemoryLayoutParams;
188+
type Params = lsp_types::TextDocumentPositionParams;
189189
type Result = Option<RecursiveMemoryLayout>;
190190
const METHOD: &'static str = "rust-analyzer/viewRecursiveMemoryLayout";
191191
}
192192

193-
#[derive(Deserialize, Serialize, Debug)]
194-
#[serde(rename_all = "camelCase")]
195-
pub struct ViewRecursiveMemoryLayoutParams {
196-
pub text_document: TextDocumentIdentifier,
197-
pub position: Position,
198-
}
199-
200193
#[derive(Deserialize, Serialize, Debug)]
201194
#[serde(rename_all = "camelCase")]
202195
pub struct RecursiveMemoryLayout {

docs/dev/lsp-extensions.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!---
2-
lsp_ext.rs hash: 12bf360ee77cc63d
2+
lsp_ext.rs hash: 149a5be3c5e469d1
33
44
If you need to change the above hash to make the test pass, please check if you
55
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
889889

890890
## View Recursive Memory Layout
891891

892-
**Method:** `rust-analyzer/fetchDependencyList`
893-
894-
**Request:**
892+
**Method:** `rust-analyzer/viewRecursiveMemoryLayout`
895893

896-
```typescript
897-
/// 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.
898-
export interface ViewRecursiveMemoryLayoutParams {
899-
textDocument: TextDocumentIdentifier;
900-
position: Position;
901-
}
902-
```
894+
**Request:** `TextDocumentPositionParams`
903895

904896
**Response:**
905897

editors/code/src/lsp_ext.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export const serverStatus = new lc.NotificationType<ServerStatusParams>(
151151
);
152152
export const ssr = new lc.RequestType<SsrParams, lc.WorkspaceEdit, void>("experimental/ssr");
153153
export const viewRecursiveMemoryLayout = new lc.RequestType<
154-
ViewRecursiveMemoryLayoutParams,
154+
lc.TextDocumentPositionParams,
155155
RecursiveMemoryLayout | null,
156156
void
157157
>("rust-analyzer/viewRecursiveMemoryLayout");
@@ -203,10 +203,6 @@ export type SsrParams = {
203203
selections: readonly lc.Range[];
204204
};
205205

206-
export type ViewRecursiveMemoryLayoutParams = {
207-
textDocument: lc.TextDocumentIdentifier;
208-
position: lc.Position;
209-
};
210206
export type RecursiveMemoryLayoutNode = {
211207
item_name: string;
212208
typename: string;

0 commit comments

Comments
 (0)