aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/main_loop/handlers.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-03-31 15:06:03 +0100
committerGitHub <[email protected]>2020-03-31 15:06:03 +0100
commitfa3c7742af9fbfe5146f4158a6119fa727dcc87a (patch)
tree897858f9eae6d759f5bc7187a18a70ecb8a45cc3 /crates/rust-analyzer/src/main_loop/handlers.rs
parent6546edc0651260f74a7e0c121120c487791d7f6d (diff)
parent569f47e427e0b9181075291c988446b86c5ba8f9 (diff)
Merge #3790
3790: Better names for config structs r=matklad a=matklad 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.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/rust-analyzer/src/main_loop/handlers.rs b/crates/rust-analyzer/src/main_loop/handlers.rs
index f60a3f0a0..d5cb5d137 100644
--- a/crates/rust-analyzer/src/main_loop/handlers.rs
+++ b/crates/rust-analyzer/src/main_loop/handlers.rs
@@ -19,7 +19,7 @@ use lsp_types::{
19 TextEdit, WorkspaceEdit, 19 TextEdit, WorkspaceEdit,
20}; 20};
21use ra_ide::{ 21use ra_ide::{
22 Assist, AssistId, CompletionOptions, FileId, FilePosition, FileRange, Query, RangeInfo, 22 Assist, AssistId, CompletionConfig, FileId, FilePosition, FileRange, Query, RangeInfo,
23 Runnable, RunnableKind, SearchScope, 23 Runnable, RunnableKind, SearchScope,
24}; 24};
25use ra_prof::profile; 25use ra_prof::profile;
@@ -425,7 +425,7 @@ pub fn handle_completion(
425 return Ok(None); 425 return Ok(None);
426 } 426 }
427 427
428 let options = CompletionOptions { 428 let config = CompletionConfig {
429 enable_postfix_completions: world.feature_flags.get("completion.enable-postfix"), 429 enable_postfix_completions: world.feature_flags.get("completion.enable-postfix"),
430 add_call_parenthesis: world.feature_flags.get("completion.insertion.add-call-parenthesis"), 430 add_call_parenthesis: world.feature_flags.get("completion.insertion.add-call-parenthesis"),
431 add_call_argument_snippets: world 431 add_call_argument_snippets: world
@@ -433,7 +433,7 @@ pub fn handle_completion(
433 .get("completion.insertion.add-argument-snippets"), 433 .get("completion.insertion.add-argument-snippets"),
434 }; 434 };
435 435
436 let items = match world.analysis().completions(position, &options)? { 436 let items = match world.analysis().completions(position, &config)? {
437 None => return Ok(None), 437 None => return Ok(None),
438 Some(items) => items, 438 Some(items) => items,
439 }; 439 };
@@ -457,7 +457,7 @@ pub fn handle_folding_range(
457 let ctx = FoldConvCtx { 457 let ctx = FoldConvCtx {
458 text: &text, 458 text: &text,
459 line_index: &line_index, 459 line_index: &line_index,
460 line_folding_only: world.options.line_folding_only, 460 line_folding_only: world.config.line_folding_only,
461 }; 461 };
462 let res = Some(folds.into_iter().map_conv_with(&ctx).collect()); 462 let res = Some(folds.into_iter().map_conv_with(&ctx).collect());
463 Ok(res) 463 Ok(res)
@@ -611,7 +611,7 @@ pub fn handle_formatting(
611 let end_position = TextUnit::of_str(&file).conv_with(&file_line_index); 611 let end_position = TextUnit::of_str(&file).conv_with(&file_line_index);
612 612
613 let mut rustfmt = process::Command::new("rustfmt"); 613 let mut rustfmt = process::Command::new("rustfmt");
614 rustfmt.args(&world.options.rustfmt_args); 614 rustfmt.args(&world.config.rustfmt_args);
615 if let Some(&crate_id) = crate_ids.first() { 615 if let Some(&crate_id) = crate_ids.first() {
616 // Assume all crates are in the same edition 616 // Assume all crates are in the same edition
617 let edition = world.analysis().crate_edition(crate_id)?; 617 let edition = world.analysis().crate_edition(crate_id)?;
@@ -815,7 +815,7 @@ pub fn handle_code_lens(
815 }; 815 };
816 lenses.push(lens); 816 lenses.push(lens);
817 817
818 if world.options.vscode_lldb { 818 if world.config.vscode_lldb {
819 if r.args[0] == "run" { 819 if r.args[0] == "run" {
820 r.args[0] = "build".into(); 820 r.args[0] = "build".into();
821 } else { 821 } else {
@@ -1028,7 +1028,7 @@ pub fn handle_inlay_hints(
1028 let analysis = world.analysis(); 1028 let analysis = world.analysis();
1029 let line_index = analysis.file_line_index(file_id)?; 1029 let line_index = analysis.file_line_index(file_id)?;
1030 Ok(analysis 1030 Ok(analysis
1031 .inlay_hints(file_id, &world.options.inlay_hints)? 1031 .inlay_hints(file_id, &world.config.inlay_hints)?
1032 .into_iter() 1032 .into_iter()
1033 .map_conv_with(&line_index) 1033 .map_conv_with(&line_index)
1034 .collect()) 1034 .collect())