diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-05-21 14:10:00 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-21 14:10:00 +0100 |
commit | 3cba0dc26b707bebc1865671fd2c5139c1e1c537 (patch) | |
tree | 6d77f69e3299d4245ebae8987fc030348ae2ebb9 /crates/rust-analyzer/src/main_loop/handlers.rs | |
parent | 0c2b548b0b5712dcc2f9a4eead57e028b5461ba7 (diff) | |
parent | ff28c79ebd4c5a9a27542917940def9d4e66eea6 (diff) |
Merge #4552
4552: Transition OnEnter to WorkspaceSnippetEdit r=matklad a=matklad
This also changes our handiling of snippet edits on the client side.
`editor.insertSnippet` unfortunately forces indentation, which we
really don't want to have to deal with. So, let's just implement our
manual hacky way of dealing with a simple subset of snippets we
actually use in rust-analyzer
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/rust-analyzer/src/main_loop/handlers.rs')
-rw-r--r-- | crates/rust-analyzer/src/main_loop/handlers.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/rust-analyzer/src/main_loop/handlers.rs b/crates/rust-analyzer/src/main_loop/handlers.rs index be6a0aece..fcf08cd79 100644 --- a/crates/rust-analyzer/src/main_loop/handlers.rs +++ b/crates/rust-analyzer/src/main_loop/handlers.rs | |||
@@ -159,12 +159,12 @@ pub fn handle_join_lines( | |||
159 | pub fn handle_on_enter( | 159 | pub fn handle_on_enter( |
160 | world: WorldSnapshot, | 160 | world: WorldSnapshot, |
161 | params: lsp_types::TextDocumentPositionParams, | 161 | params: lsp_types::TextDocumentPositionParams, |
162 | ) -> Result<Option<lsp_ext::SourceChange>> { | 162 | ) -> Result<Option<lsp_ext::SnippetWorkspaceEdit>> { |
163 | let _p = profile("handle_on_enter"); | 163 | let _p = profile("handle_on_enter"); |
164 | let position = from_proto::file_position(&world, params)?; | 164 | let position = from_proto::file_position(&world, params)?; |
165 | match world.analysis().on_enter(position)? { | 165 | match world.analysis().on_enter(position)? { |
166 | None => Ok(None), | 166 | None => Ok(None), |
167 | Some(source_change) => to_proto::source_change(&world, source_change).map(Some), | 167 | Some(source_change) => to_proto::snippet_workspace_edit(&world, source_change).map(Some), |
168 | } | 168 | } |
169 | } | 169 | } |
170 | 170 | ||