change viewMemoryLayoutParams to be textPositionParams

This commit is contained in:
Adenine 2023-07-08 12:25:54 -04:00
parent 514bab504e
commit 1dd54eb44a
4 changed files with 6 additions and 25 deletions

View file

@ -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, &params.text_document.uri)?;

View file

@ -185,18 +185,11 @@ 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 {

View file

@ -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`
**Method:** `rust-analyzer/viewRecursiveMemoryLayout`
**Request:**
```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:**

View file

@ -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;