Skip to content

Commit

Permalink
Convert to struct.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Jun 18, 2021
1 parent 1c2f30b commit 8940d22
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
13 changes: 7 additions & 6 deletions cli/lsp/language_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1766,13 +1766,14 @@ impl Inner {
)));
};

let req = tsc::RequestMethod::FindRenameLocations((
let req = tsc::RequestMethod::FindRenameLocations {
specifier,
line_index.offset_tsc(params.text_document_position.position)?,
false,
false,
false,
));
position: line_index
.offset_tsc(params.text_document_position.position)?,
find_in_strings: false,
find_in_comments: false,
provide_prefix_and_suffix_text_for_rename: false,
};

let maybe_locations: Option<Vec<tsc::RenameLocation>> = self
.ts_server
Expand Down
12 changes: 9 additions & 3 deletions cli/lsp/tsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2319,7 +2319,13 @@ pub enum RequestMethod {
/// Configure the compilation settings for the server.
Configure(TsConfig),
/// Get rename locations at a given position.
FindRenameLocations((ModuleSpecifier, u32, bool, bool, bool)),
FindRenameLocations {
specifier: ModuleSpecifier,
position: u32,
find_in_strings: bool,
find_in_comments: bool,
provide_prefix_and_suffix_text_for_rename: bool,
},
/// Retrieve the text of an assets that exists in memory in the isolate.
GetAsset(ModuleSpecifier),
/// Retrieve code fixes for a range of a file with the provided error codes.
Expand Down Expand Up @@ -2370,13 +2376,13 @@ impl RequestMethod {
"method": "configure",
"compilerOptions": config,
}),
RequestMethod::FindRenameLocations((
RequestMethod::FindRenameLocations {
specifier,
position,
find_in_strings,
find_in_comments,
provide_prefix_and_suffix_text_for_rename,
)) => {
} => {
json!({
"id": id,
"method": "findRenameLocations",
Expand Down

0 comments on commit 8940d22

Please sign in to comment.