diff options
author | Aleksey Kladov <[email protected]> | 2020-05-17 20:24:33 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-05-19 19:28:27 +0100 |
commit | a752853350639a915178ea900a51f3c45443795e (patch) | |
tree | 53fe8ac7cc20109436fb54dfde9ed1c4baba1ad2 /crates | |
parent | fa2e5299c3332b99fcd09fd54e8d812a6c34b0cc (diff) |
Add snippetTextEdit protocol extension
Diffstat (limited to 'crates')
-rw-r--r-- | crates/rust-analyzer/src/config.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index 063b1b316..d75c48597 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs | |||
@@ -275,6 +275,7 @@ impl Config { | |||
275 | { | 275 | { |
276 | self.client_caps.code_action_literals = value; | 276 | self.client_caps.code_action_literals = value; |
277 | } | 277 | } |
278 | |||
278 | self.completion.allow_snippets(false); | 279 | self.completion.allow_snippets(false); |
279 | if let Some(completion) = &doc_caps.completion { | 280 | if let Some(completion) = &doc_caps.completion { |
280 | if let Some(completion_item) = &completion.completion_item { | 281 | if let Some(completion_item) = &completion.completion_item { |
@@ -283,7 +284,6 @@ impl Config { | |||
283 | } | 284 | } |
284 | } | 285 | } |
285 | } | 286 | } |
286 | self.assist.allow_snippets(false); | ||
287 | } | 287 | } |
288 | 288 | ||
289 | if let Some(window_caps) = caps.window.as_ref() { | 289 | if let Some(window_caps) = caps.window.as_ref() { |
@@ -291,5 +291,12 @@ impl Config { | |||
291 | self.client_caps.work_done_progress = value; | 291 | self.client_caps.work_done_progress = value; |
292 | } | 292 | } |
293 | } | 293 | } |
294 | |||
295 | self.assist.allow_snippets(false); | ||
296 | if let Some(experimental) = &caps.experimental { | ||
297 | let enable = | ||
298 | experimental.get("snippetTextEdit").and_then(|it| it.as_bool()) == Some(true); | ||
299 | self.assist.allow_snippets(enable); | ||
300 | } | ||
294 | } | 301 | } |
295 | } | 302 | } |