Repository: rust-analyzer/rust-analyzer
Pull request #3790 (2020-03-31 14:05:37)

Better names for config structs


bors r+
🤖


Patch:
diff --git a/crates/ra_cargo_watch/src/lib.rs b/crates/ra_cargo_watch/src/lib.rs
index 2692c1bf55..77ede8f635 100644
--- a/crates/ra_cargo_watch/src/lib.rs
+++ b/crates/ra_cargo_watch/src/lib.rs
@@ -22,7 +22,7 @@ use crate::conv::{map_rust_diagnostic_to_lsp, MappedRustDiagnostic};
 pub use crate::conv::url_from_path_with_drive_lowercasing;
 
 #[derive(Clone, Debug)]
-pub struct CheckOptions {
+pub struct CheckConfig {
     pub enable: bool,
     pub args: Vec<String>,
     pub command: String,
@@ -42,13 +42,11 @@ pub struct CheckWatcher {
 }
 
 impl CheckWatcher {
-    pub fn new(options: &CheckOptions, workspace_root: PathBuf) -> CheckWatcher {
-        let options = options.clone();
-
+    pub fn new(config: CheckConfig, workspace_root: PathBuf) -> CheckWatcher {
         let (task_send, task_recv) = unbounded::<CheckTask>();
         let (cmd_send, cmd_recv) = unbounded::<CheckCommand>();
         let handle = jod_thread::spawn(move || {
-            let mut check = CheckWatcherThread::new(options, workspace_root);
+            let mut check = CheckWatcherThread::new(config, workspace_root);
             check.run(&task_send, &cmd_recv);
         });
         CheckWatcher { task_recv, cmd_send, handle: Some(handle) }
@@ -78,14 +76,14 @@ pub enum CheckCommand {
 }
 
 struct CheckWatcherThread {
-    options: CheckOptions,
+    options: CheckConfig,
     workspace_root: PathBuf,
     watcher: WatchThread,
     last_update_req: Option<Instant>,
 }
 
 impl CheckWatcherThread {
-    fn new(options: CheckOptions, workspace_root: PathBuf) -> CheckWatcherThread {
+    fn new(options: CheckConfig, workspace_root: PathBuf) -> CheckWatcherThread {
         CheckWatcherThread {
             options,
             workspace_root,
@@ -324,7 +322,7 @@ impl WatchThread {
         WatchThread { message_recv: never(), _handle: None }
     }
 
-    fn new(options: &CheckOptions, workspace_root: &Path) -> WatchThread {
+    fn new(options: &CheckConfig, workspace_root: &Path) -> WatchThread {
         let mut args: Vec<String> = vec![
             options.command.clone(),
             "--workspace".to_string(),
diff --git a/crates/ra_ide/src/completion.rs b/crates/ra_ide/src/completion.rs
index cd0757be5f..b683572fbf 100644
--- a/crates/ra_ide/src/completion.rs
+++ b/crates/ra_ide/src/completion.rs
@@ -34,15 +34,15 @@ pub use crate::completion::completion_item::{
 };
 
 #[derive(Clone, Debug, PartialEq, Eq)]
-pub struct CompletionOptions {
+pub struct CompletionConfig {
     pub enable_postfix_completions: bool,
     pub add_call_parenthesis: bool,
     pub add_call_argument_snippets: bool,
 }
 
-impl Default for CompletionOptions {
+impl Default for CompletionConfig {
     fn default() -> Self {
-        CompletionOptions {
+        CompletionConfig {
             enable_postfix_completions: true,
             add_call_parenthesis: true,
             add_call_argument_snippets: true,
@@ -75,9 +75,9 @@ impl Default for CompletionOptions {
 pub(crate) fn completions(
     db: &RootDatabase,
     position: FilePosition,
-    options: &CompletionOptions,
+    config: &CompletionConfig,
 ) -> Option<Completions> {
-    let ctx = CompletionContext::new(db, position, options)?;
+    let ctx = CompletionContext::new(db, position, config)?;
 
     let mut acc = Completions::default();
 
diff --git a/crates/ra_ide/src/completion/complete_postfix.rs b/crates/ra_ide/src/completion/complete_postfix.rs
index 0a00054b23..29c2881c62 100644
--- a/crates/ra_ide/src/completion/complete_postfix.rs
+++ b/crates/ra_ide/src/completion/complete_postfix.rs
@@ -15,7 +15,7 @@ use crate::{
 };
 
 pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
-    if !ctx.options.enable_postfix_completions {
+    if !ctx.config.enable_postfix_completions {
         return;
     }
 
diff --git a/crates/ra_ide/src/completion/completion_context.rs b/crates/ra_ide/src/completion/completion_context.rs
index 319e33b615..fdc0da2c5e 100644
--- a/crates/ra_ide/src/completion/completion_context.rs
+++ b/crates/ra_ide/src/completion/completion_context.rs
@@ -11,7 +11,7 @@ use ra_syntax::{
 };
 use ra_text_edit::AtomTextEdit;
 
-use crate::{completion::CompletionOptions, FilePosition};
+use crate::{completion::CompletionConfig, FilePosition};
 
 /// `CompletionContext` is created early during completion to figure out, where
 /// exactly is the cursor, syntax-wise.
@@ -19,7 +19,7 @@ use crate::{completion::CompletionOptions, FilePosition};
 pub(crate) struct CompletionContext<'a> {
     pub(super) sema: Semantics<'a, RootDatabase>,
     pub(super) db: &'a RootDatabase,
-    pub(super) options: &'a CompletionOptions,
+    pub(super) config: &'a CompletionConfig,
     pub(super) offset: TextUnit,
     /// The token before the cursor, in the original file.
     pub(super) original_token: SyntaxToken,
@@ -61,7 +61,7 @@ impl<'a> CompletionContext<'a> {
     pub(super) fn new(
         db: &'a RootDatabase,
         position: FilePosition,
-        options: &'a CompletionOptions,
+        config: &'a CompletionConfig,
     ) -> Option<CompletionContext<'a>> {
         let sema = Semantics::new(db);
 
@@ -85,7 +85,7 @@ impl<'a> CompletionContext<'a> {
         let mut ctx = CompletionContext {
             sema,
             db,
-            options,
+            config,
             original_token,
             token,
             offset: position.offset,
diff --git a/crates/ra_ide/src/completion/presentation.rs b/crates/ra_ide/src/completion/presentation.rs
index 60f1b83f33..1c7c0924db 100644
--- a/crates/ra_ide/src/completion/presentation.rs
+++ b/crates/ra_ide/src/completion/presentation.rs
@@ -106,7 +106,7 @@ impl Completions {
         };
 
         // Add `<>` for generic types
-        if ctx.is_path_type && !ctx.has_type_args && ctx.options.add_call_parenthesis {
+        if ctx.is_path_type && !ctx.has_type_args && ctx.config.add_call_parenthesis {
             let has_non_default_type_params = match resolution {
                 ScopeDef::ModuleDef(Adt(it)) => it.has_non_default_type_params(ctx.db),
                 ScopeDef::ModuleDef(TypeAlias(it)) => it.has_non_default_type_params(ctx.db),
@@ -211,14 +211,14 @@ impl Completions {
                 .detail(function_signature.to_string());
 
         // If not an import, add parenthesis automatically.
-        if ctx.use_item_syntax.is_none() && !ctx.is_call && ctx.options.add_call_parenthesis {
+        if ctx.use_item_syntax.is_none() && !ctx.is_call && ctx.config.add_call_parenthesis {
             tested_by!(inserts_parens_for_function_calls);
 
             let (snippet, label) = if params.is_empty() || has_self_param && params.len() == 1 {
                 (format!("{}()$0", name), format!("{}()", name))
             } else {
                 builder = builder.trigger_call_info();
-                let snippet = if ctx.options.add_call_argument_snippets {
+                let snippet = if ctx.config.add_call_argument_snippets {
                     let to_skip = if has_self_param { 1 } else { 0 };
                     let function_params_snippet = function_signature
                         .parameter_names
@@ -311,7 +311,7 @@ mod tests {
 
     use crate::completion::{
         test_utils::{do_completion, do_completion_with_options},
-        CompletionItem, CompletionKind, CompletionOptions,
+        CompletionConfig, CompletionItem, CompletionKind,
     };
 
     fn do_reference_completion(ra_fixture: &str) -> Vec<CompletionItem> {
@@ -320,7 +320,7 @@ mod tests {
 
     fn do_reference_completion_with_options(
         ra_fixture: &str,
-        options: CompletionOptions,
+        options: CompletionConfig,
     ) -> Vec<CompletionItem> {
         do_completion_with_options(ra_fixture, CompletionKind::Reference, &options)
     }
@@ -589,7 +589,7 @@ mod tests {
                     s.f<|>
                 }
                 ",
-                CompletionOptions {
+                CompletionConfig {
                     add_call_argument_snippets: false,
                     .. Default::default()
                 }
diff --git a/crates/ra_ide/src/inlay_hints.rs b/crates/ra_ide/src/inlay_hints.rs
index f4f0751c05..d06fc03d3e 100644
--- a/crates/ra_ide/src/inlay_hints.rs
+++ b/crates/ra_ide/src/inlay_hints.rs
@@ -11,14 +11,14 @@ use ra_syntax::{
 use crate::{FileId, FunctionSignature};
 
 #[derive(Clone, Debug, PartialEq, Eq)]
-pub struct InlayHintsOptions {
+pub struct InlayHintsConfig {
     pub type_hints: bool,
     pub parameter_hints: bool,
     pub chaining_hints: bool,
     pub max_length: Option<usize>,
 }
 
-impl Default for InlayHintsOptions {
+impl Default for InlayHintsConfig {
     fn default() -> Self {
         Self { type_hints: true, parameter_hints: true, chaining_hints: true, max_length: None }
     }
@@ -41,7 +41,7 @@ pub struct InlayHint {
 pub(crate) fn inlay_hints(
     db: &RootDatabase,
     file_id: FileId,
-    options: &InlayHintsOptions,
+    config: &InlayHintsConfig,
 ) -> Vec<InlayHint> {
     let _p = profile("inlay_hints");
     let sema = Semantics::new(db);
@@ -50,14 +50,14 @@ pub(crate) fn inlay_hints(
     let mut res = Vec::new();
     for node in file.syntax().descendants() {
         if let Some(expr) = ast::Expr::cast(node.clone()) {
-            get_chaining_hints(&mut res, &sema, options, expr);
+            get_chaining_hints(&mut res, &sema, config, expr);
         }
 
         match_ast! {
             match node {
-                ast::CallExpr(it) => { get_param_name_hints(&mut res, &sema, options, ast::Expr::from(it)); },
-                ast::MethodCallExpr(it) => { get_param_name_hints(&mut res, &sema, options, ast::Expr::from(it)); },
-                ast::BindPat(it) => { get_bind_pat_hints(&mut res, &sema, options, it); },
+                ast::CallExpr(it) => { get_param_name_hints(&mut res, &sema, config, ast::Expr::from(it)); },
+                ast::MethodCallExpr(it) => { get_param_name_hints(&mut res, &sema, config, ast::Expr::from(it)); },
+                ast::BindPat(it) => { get_bind_pat_hints(&mut res, &sema, config, it); },
                 _ => (),
             }
         }
@@ -68,10 +68,10 @@ pub(crate) fn inlay_hints(
 fn get_chaining_hints(
     acc: &mut Vec<InlayHint>,
     sema: &Semantics<RootDatabase>,
-    options: &InlayHintsOptions,
+    config: &InlayHintsConfig,
     expr: ast::Expr,
 ) -> Option<()> {
-    if !options.chaining_hints {
+    if !config.chaining_hints {
         return None;
     }
 
@@ -95,7 +95,7 @@ fn get_chaining_hints(
     let next = tokens.next()?.kind();
     let next_next = tokens.next()?.kind();
     if next == SyntaxKind::WHITESPACE && next_next == SyntaxKind::DOT {
-        let label = ty.display_truncated(sema.db, options.max_length).to_string();
+        let label = ty.display_truncated(sema.db, config.max_length).to_string();
         acc.push(InlayHint {
             range: expr.syntax().text_range(),
             kind: InlayKind::ChainingHint,
@@ -108,10 +108,10 @@ fn get_chaining_hints(
 fn get_param_name_hints(
     acc: &mut Vec<InlayHint>,
     sema: &Semantics<RootDatabase>,
-    options: &InlayHintsOptions,
+    config: &InlayHintsConfig,
     expr: ast::Expr,
 ) -> Option<()> {
-    if !options.parameter_hints {
+    if !config.parameter_hints {
         return None;
     }
 
@@ -148,10 +148,10 @@ fn get_param_name_hints(
 fn get_bind_pat_hints(
     acc: &mut Vec<InlayHint>,
     sema: &Semantics<RootDatabase>,
-    options: &InlayHintsOptions,
+    config: &InlayHintsConfig,
     pat: ast::BindPat,
 ) -> Option<()> {
-    if !options.type_hints {
+    if !config.type_hints {
         return None;
     }
 
@@ -164,7 +164,7 @@ fn get_bind_pat_hints(
     acc.push(InlayHint {
         range: pat.syntax().text_range(),
         kind: InlayKind::TypeHint,
-        label: ty.display_truncated(sema.db, options.max_length).to_string().into(),
+        label: ty.display_truncated(sema.db, config.max_length).to_string().into(),
     });
     Some(())
 }
@@ -270,7 +270,7 @@ fn get_fn_signature(sema: &Semantics<RootDatabase>, expr: &ast::Expr) -> Option<
 
 #[cfg(test)]
 mod tests {
-    use crate::inlay_hints::InlayHintsOptions;
+    use crate::inlay_hints::InlayHintsConfig;
     use insta::assert_debug_snapshot;
 
     use crate::mock_analysis::single_file;
@@ -284,7 +284,7 @@ mod tests {
                 let _x = foo(4, 4);
             }"#,
         );
-        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsOptions{ parameter_hints: true, type_hints: false, chaining_hints: false, max_length: None}).unwrap(), @r###"
+        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig{ parameter_hints: true, type_hints: false, chaining_hints: false, max_length: None}).unwrap(), @r###"
         [
             InlayHint {
                 range: [106; 107),
@@ -308,7 +308,7 @@ mod tests {
                 let _x = foo(4, 4);
             }"#,
         );
-        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsOptions{ type_hints: false, parameter_hints: false, chaining_hints: false, max_length: None}).unwrap(), @r###"[]"###);
+        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig{ type_hints: false, parameter_hints: false, chaining_hints: false, max_length: None}).unwrap(), @r###"[]"###);
     }
 
     #[test]
@@ -320,7 +320,7 @@ mod tests {
                 let _x = foo(4, 4);
             }"#,
         );
-        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsOptions{ type_hints: true, parameter_hints: false, chaining_hints: false, max_length: None}).unwrap(), @r###"
+        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig{ type_hints: true, parameter_hints: false, chaining_hints: false, max_length: None}).unwrap(), @r###"
         [
             InlayHint {
                 range: [97; 99),
@@ -344,7 +344,7 @@ fn main() {
 }"#,
         );
 
-        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsOptions::default()).unwrap(), @r###"
+        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig::default()).unwrap(), @r###"
         [
             InlayHint {
                 range: [69; 71),
@@ -401,7 +401,7 @@ fn main() {
 }"#,
         );
 
-        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsOptions::default()).unwrap(), @r###"
+        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig::default()).unwrap(), @r###"
         [
             InlayHint {
                 range: [193; 197),
@@ -481,7 +481,7 @@ fn main() {
 }"#,
         );
 
-        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsOptions::default()).unwrap(), @r###"
+        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig::default()).unwrap(), @r###"
         [
             InlayHint {
                 range: [21; 30),
@@ -545,7 +545,7 @@ fn main() {
 }"#,
         );
 
-        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsOptions::default()).unwrap(), @r###"
+        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig::default()).unwrap(), @r###"
         [
             InlayHint {
                 range: [21; 30),
@@ -595,7 +595,7 @@ fn main() {
 }"#,
         );
 
-        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsOptions::default()).unwrap(), @r###"
+        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig::default()).unwrap(), @r###"
         [
             InlayHint {
                 range: [188; 192),
@@ -690,7 +690,7 @@ fn main() {
 }"#,
         );
 
-        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsOptions::default()).unwrap(), @r###"
+        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig::default()).unwrap(), @r###"
         [
             InlayHint {
                 range: [188; 192),
@@ -785,7 +785,7 @@ fn main() {
 }"#,
         );
 
-        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsOptions::default()).unwrap(), @r###"
+        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig::default()).unwrap(), @r###"
         [
             InlayHint {
                 range: [252; 256),
@@ -857,7 +857,7 @@ fn main() {
 }"#,
         );
 
-        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsOptions { max_length: Some(8), ..Default::default() }).unwrap(), @r###"
+        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig { max_length: Some(8), ..Default::default() }).unwrap(), @r###"
         [
             InlayHint {
                 range: [74; 75),
@@ -945,7 +945,7 @@ fn main() {
 }"#,
         );
 
-        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsOptions::default()).unwrap(), @r###"
+        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig::default()).unwrap(), @r###"
         [
             InlayHint {
                 range: [798; 809),
@@ -1067,7 +1067,7 @@ fn main() {
 }"#,
         );
 
-        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsOptions { max_length: Some(8), ..Default::default() }).unwrap(), @r###"
+        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig { max_length: Some(8), ..Default::default() }).unwrap(), @r###"
         []
         "###
         );
@@ -1093,7 +1093,7 @@ fn main() {
 }"#,
         );
 
-        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsOptions { max_length: Some(8), ..Default::default() }).unwrap(), @r###"
+        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig { max_length: Some(8), ..Default::default() }).unwrap(), @r###"
         []
         "###
         );
@@ -1115,7 +1115,7 @@ fn main() {
                     .into_c();
             }"#,
         );
-        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsOptions{ parameter_hints: false, type_hints: false, chaining_hints: true, max_length: None}).unwrap(), @r###"
+        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig{ parameter_hints: false, type_hints: false, chaining_hints: true, max_length: None}).unwrap(), @r###"
         [
             InlayHint {
                 range: [232; 269),
@@ -1144,7 +1144,7 @@ fn main() {
                 let c = A(B(C)).into_b().into_c();
             }"#,
         );
-        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsOptions{ parameter_hints: false, type_hints: false, chaining_hints: true, max_length: None}).unwrap(), @r###"[]"###);
+        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig{ parameter_hints: false, type_hints: false, chaining_hints: true, max_length: None}).unwrap(), @r###"[]"###);
     }
 
     #[test]
@@ -1162,7 +1162,7 @@ fn main() {
                     .0;
             }"#,
         );
-        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsOptions{ parameter_hints: false, type_hints: false, chaining_hints: true, max_length: None}).unwrap(), @r###"
+        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig{ parameter_hints: false, type_hints: false, chaining_hints: true, max_length: None}).unwrap(), @r###"
         [
             InlayHint {
                 range: [150; 221),
@@ -1204,7 +1204,7 @@ fn main() {
                     .into_c();
             }"#,
         );
-        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsOptions{ parameter_hints: false, type_hints: false, chaining_hints: true, max_length: None}).unwrap(), @r###"
+        assert_debug_snapshot!(analysis.inlay_hints(file_id, &InlayHintsConfig{ parameter_hints: false, type_hints: false, chaining_hints: true, max_length: None}).unwrap(), @r###"
         [
             InlayHint {
                 range: [403; 452),
diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs
index 937c9caa51..2853810865 100644
--- a/crates/ra_ide/src/lib.rs
+++ b/crates/ra_ide/src/lib.rs
@@ -62,13 +62,13 @@ use crate::display::ToNav;
 pub use crate::{
     assists::{Assist, AssistId},
     call_hierarchy::CallItem,
-    completion::{CompletionItem, CompletionItemKind, CompletionOptions, InsertTextFormat},
+    completion::{CompletionConfig, CompletionItem, CompletionItemKind, InsertTextFormat},
     diagnostics::Severity,
     display::{file_structure, FunctionSignature, NavigationTarget, StructureNode},
     expand_macro::ExpandedMacro,
     folding_ranges::{Fold, FoldKind},
     hover::HoverResult,
-    inlay_hints::{InlayHint, InlayHintsOptions, InlayKind},
+    inlay_hints::{InlayHint, InlayHintsConfig, InlayKind},
     references::{Declaration, Reference, ReferenceAccess, ReferenceKind, ReferenceSearchResult},
     runnables::{Runnable, RunnableKind, TestId},
     source_change::{FileSystemEdit, SourceChange, SourceFileEdit},
@@ -325,9 +325,9 @@ impl Analysis {
     pub fn inlay_hints(
         &self,
         file_id: FileId,
-        inlay_hint_opts: &InlayHintsOptions,
+        config: &InlayHintsConfig,
     ) -> Cancelable<Vec<InlayHint>> {
-        self.with_db(|db| inlay_hints::inlay_hints(db, file_id, inlay_hint_opts))
+        self.with_db(|db| inlay_hints::inlay_hints(db, file_id, config))
     }
 
     /// Returns the set of folding ranges.
@@ -450,9 +450,9 @@ impl Analysis {
     pub fn completions(
         &self,
         position: FilePosition,
-        options: &CompletionOptions,
+        config: &CompletionConfig,
     ) -> Cancelable<Option<Vec<CompletionItem>>> {
-        self.with_db(|db| completion::completions(db, position, options).map(Into::into))
+        self.with_db(|db| completion::completions(db, position, config).map(Into::into))
     }
 
     /// Computes assists (aka code actions aka intentions) for the given
diff --git a/crates/rust-analyzer/src/cli/analysis_bench.rs b/crates/rust-analyzer/src/cli/analysis_bench.rs
index 7164b0adeb..7667873d5f 100644
--- a/crates/rust-analyzer/src/cli/analysis_bench.rs
+++ b/crates/rust-analyzer/src/cli/analysis_bench.rs
@@ -12,7 +12,7 @@ use ra_db::{
     salsa::{Database, Durability},
     FileId, SourceDatabaseExt,
 };
-use ra_ide::{Analysis, AnalysisChange, AnalysisHost, CompletionOptions, FilePosition, LineCol};
+use ra_ide::{Analysis, AnalysisChange, AnalysisHost, CompletionConfig, FilePosition, LineCol};
 
 use crate::cli::{load_cargo::load_cargo, Verbosity};
 
@@ -102,7 +102,7 @@ pub fn analysis_bench(
             let file_position = FilePosition { file_id, offset };
 
             if is_completion {
-                let options = CompletionOptions::default();
+                let options = CompletionConfig::default();
                 let res = do_work(&mut host, file_id, |analysis| {
                     analysis.completions(file_position, &options)
                 });
diff --git a/crates/rust-analyzer/src/conv.rs b/crates/rust-analyzer/src/conv.rs
index 6edc03fe0f..e8dc953c38 100644
--- a/crates/rust-analyzer/src/conv.rs
+++ b/crates/rust-analyzer/src/conv.rs
@@ -579,7 +579,7 @@ impl TryConvWith<&WorldSnapshot> for (FileId, RangeInfo<Vec<NavigationTarget>>)
             .into_iter()
             .map(|nav| (file_id, RangeInfo::new(range, nav)))
             .try_conv_with_to_vec(world)?;
-        if world.options.supports_location_link {
+        if world.config.supports_location_link {
             Ok(links.into())
         } else {
             let locations: Vec<Location> = links
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs
index d818243e33..c233f72ffe 100644
--- a/crates/rust-analyzer/src/main_loop.rs
+++ b/crates/rust-analyzer/src/main_loop.rs
@@ -21,8 +21,8 @@ use lsp_types::{
     WorkDoneProgressBegin, WorkDoneProgressCreateParams, WorkDoneProgressEnd,
     WorkDoneProgressReport,
 };
-use ra_cargo_watch::{url_from_path_with_drive_lowercasing, CheckOptions, CheckTask};
-use ra_ide::{Canceled, FileId, InlayHintsOptions, LibraryData, SourceRootId};
+use ra_cargo_watch::{url_from_path_with_drive_lowercasing, CheckConfig, CheckTask};
+use ra_ide::{Canceled, FileId, InlayHintsConfig, LibraryData, SourceRootId};
 use ra_prof::profile;
 use ra_vfs::{VfsFile, VfsTask, Watch};
 use relative_path::RelativePathBuf;
@@ -38,7 +38,7 @@ use crate::{
         subscriptions::Subscriptions,
     },
     req,
-    world::{Options, WorldSnapshot, WorldState},
+    world::{Config, WorldSnapshot, WorldState},
     Result, ServerConfig,
 };
 use req::ConfigurationParams;
@@ -81,11 +81,11 @@ fn get_feature_flags(config: &ServerConfig, connection: &Connection) -> FeatureF
     ff
 }
 
-fn get_options(
+fn get_config(
     config: &ServerConfig,
     text_document_caps: Option<&TextDocumentClientCapabilities>,
-) -> Options {
-    Options {
+) -> Config {
+    Config {
         publish_decorations: config.publish_decorations,
         supports_location_link: text_document_caps
             .and_then(|it| it.definition)
@@ -95,13 +95,13 @@ fn get_options(
             .and_then(|it| it.folding_range.as_ref())
             .and_then(|it| it.line_folding_only)
             .unwrap_or(false),
-        inlay_hints: InlayHintsOptions {
+        inlay_hints: InlayHintsConfig {
             type_hints: config.inlay_hints_type,
             parameter_hints: config.inlay_hints_parameter,
             chaining_hints: config.inlay_hints_chaining,
             max_length: config.inlay_hints_max_length,
         },
-        cargo_watch: CheckOptions {
+        check: CheckConfig {
             enable: config.cargo_watch_enable,
             args: config.cargo_watch_args.clone(),
             command: config.cargo_watch_command.clone(),
@@ -210,7 +210,7 @@ pub fn main_loop(
             config.lru_capacity,
             &globs,
             Watch(!config.use_client_watching),
-            get_options(&config, text_document_caps),
+            get_config(&config, text_document_caps),
             feature_flags,
         )
     };
@@ -435,7 +435,7 @@ fn loop_turn(
                                 .to_owned();
                             world_state.update_configuration(
                                 new_config.lru_capacity,
-                                get_options(&new_config, text_document_caps),
+                                get_config(&new_config, text_document_caps),
                                 get_feature_flags(&new_config, connection),
                             );
                         }
@@ -498,7 +498,7 @@ fn loop_turn(
         update_file_notifications_on_threadpool(
             pool,
             world_state.snapshot(),
-            world_state.options.publish_decorations,
+            world_state.config.publish_decorations,
             task_sender.clone(),
             loop_state.subscriptions.subscriptions(),
         )
diff --git a/crates/rust-analyzer/src/main_loop/handlers.rs b/crates/rust-analyzer/src/main_loop/handlers.rs
index f60a3f0a0b..d5cb5d1372 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::{
     TextEdit, WorkspaceEdit,
 };
 use ra_ide::{
-    Assist, AssistId, CompletionOptions, FileId, FilePosition, FileRange, Query, RangeInfo,
+    Assist, AssistId, CompletionConfig, FileId, FilePosition, FileRange, Query, RangeInfo,
     Runnable, RunnableKind, SearchScope,
 };
 use ra_prof::profile;
@@ -425,7 +425,7 @@ pub fn handle_completion(
         return Ok(None);
     }
 
-    let options = CompletionOptions {
+    let config = CompletionConfig {
         enable_postfix_completions: world.feature_flags.get("completion.enable-postfix"),
         add_call_parenthesis: world.feature_flags.get("completion.insertion.add-call-parenthesis"),
         add_call_argument_snippets: world
@@ -433,7 +433,7 @@ pub fn handle_completion(
             .get("completion.insertion.add-argument-snippets"),
     };
 
-    let items = match world.analysis().completions(position, &options)? {
+    let items = match world.analysis().completions(position, &config)? {
         None => return Ok(None),
         Some(items) => items,
     };
@@ -457,7 +457,7 @@ pub fn handle_folding_range(
     let ctx = FoldConvCtx {
         text: &text,
         line_index: &line_index,
-        line_folding_only: world.options.line_folding_only,
+        line_folding_only: world.config.line_folding_only,
     };
     let res = Some(folds.into_iter().map_conv_with(&ctx).collect());
     Ok(res)
@@ -611,7 +611,7 @@ pub fn handle_formatting(
     let end_position = TextUnit::of_str(&file).conv_with(&file_line_index);
 
     let mut rustfmt = process::Command::new("rustfmt");
-    rustfmt.args(&world.options.rustfmt_args);
+    rustfmt.args(&world.config.rustfmt_args);
     if let Some(&crate_id) = crate_ids.first() {
         // Assume all crates are in the same edition
         let edition = world.analysis().crate_edition(crate_id)?;
@@ -815,7 +815,7 @@ pub fn handle_code_lens(
         };
         lenses.push(lens);
 
-        if world.options.vscode_lldb {
+        if world.config.vscode_lldb {
             if r.args[0] == "run" {
                 r.args[0] = "build".into();
             } else {
@@ -1028,7 +1028,7 @@ pub fn handle_inlay_hints(
     let analysis = world.analysis();
     let line_index = analysis.file_line_index(file_id)?;
     Ok(analysis
-        .inlay_hints(file_id, &world.options.inlay_hints)?
+        .inlay_hints(file_id, &world.config.inlay_hints)?
         .into_iter()
         .map_conv_with(&line_index)
         .collect())
diff --git a/crates/rust-analyzer/src/world.rs b/crates/rust-analyzer/src/world.rs
index ad096a1d89..a15a7085f2 100644
--- a/crates/rust-analyzer/src/world.rs
+++ b/crates/rust-analyzer/src/world.rs
@@ -11,9 +11,9 @@ use std::{
 use crossbeam_channel::{unbounded, Receiver};
 use lsp_types::Url;
 use parking_lot::RwLock;
-use ra_cargo_watch::{url_from_path_with_drive_lowercasing, CheckOptions, CheckWatcher};
+use ra_cargo_watch::{url_from_path_with_drive_lowercasing, CheckConfig, CheckWatcher};
 use ra_ide::{
-    Analysis, AnalysisChange, AnalysisHost, CrateGraph, FileId, InlayHintsOptions, LibraryData,
+    Analysis, AnalysisChange, AnalysisHost, CrateGraph, FileId, InlayHintsConfig, LibraryData,
     SourceRootId,
 };
 use ra_project_model::{get_rustc_cfg_options, ProcMacroClient, ProjectWorkspace};
@@ -31,7 +31,7 @@ use crate::{
 use ra_db::ExternSourceId;
 use rustc_hash::{FxHashMap, FxHashSet};
 
-fn create_watcher(workspaces: &[ProjectWorkspace], options: &Options) -> Option<CheckWatcher> {
+fn create_watcher(workspaces: &[ProjectWorkspace], config: &Config) -> Option<CheckWatcher> {
     // FIXME: Figure out the multi-workspace situation
     workspaces
         .iter()
@@ -41,7 +41,7 @@ fn create_watcher(workspaces: &[ProjectWorkspace], options: &Options) -> Option<
         })
         .map(|cargo| {
             let cargo_project_root = cargo.workspace_root().to_path_buf();
-            Some(CheckWatcher::new(&options.cargo_watch, cargo_project_root))
+            Some(CheckWatcher::new(config.check.clone(), cargo_project_root))
         })
         .unwrap_or_else(|| {
             log::warn!("Cargo check watching only supported for cargo workspaces, disabling");
@@ -50,13 +50,13 @@ fn create_watcher(workspaces: &[ProjectWorkspace], options: &Options) -> Option<
 }
 
 #[derive(Debug, Clone)]
-pub struct Options {
+pub struct Config {
     pub publish_decorations: bool,
     pub supports_location_link: bool,
     pub line_folding_only: bool,
-    pub inlay_hints: InlayHintsOptions,
+    pub inlay_hints: InlayHintsConfig,
     pub rustfmt_args: Vec<String>,
-    pub cargo_watch: CheckOptions,
+    pub check: CheckConfig,
     pub vscode_lldb: bool,
 }
 
@@ -67,7 +67,7 @@ pub struct Options {
 /// incremental salsa database.
 #[derive(Debug)]
 pub struct WorldState {
-    pub options: Options,
+    pub config: Config,
     pub feature_flags: Arc<FeatureFlags>,
     pub roots: Vec<PathBuf>,
     pub workspaces: Arc<Vec<ProjectWorkspace>>,
@@ -81,7 +81,7 @@ pub struct WorldState {
 
 /// An immutable snapshot of the world's state at a point in time.
 pub struct WorldSnapshot {
-    pub options: Options,
+    pub config: Config,
     pub feature_flags: Arc<FeatureFlags>,
     pub workspaces: Arc<Vec<ProjectWorkspace>>,
     pub analysis: Analysis,
@@ -97,7 +97,7 @@ impl WorldState {
         lru_capacity: Option<usize>,
         exclude_globs: &[Glob],
         watch: Watch,
-        options: Options,
+        config: Config,
         feature_flags: FeatureFlags,
     ) -> WorldState {
         let mut change = AnalysisChange::new();
@@ -185,12 +185,12 @@ impl WorldState {
             });
         change.set_crate_graph(crate_graph);
 
-        let check_watcher = create_watcher(&workspaces, &options);
+        let check_watcher = create_watcher(&workspaces, &config);
 
         let mut analysis_host = AnalysisHost::new(lru_capacity);
         analysis_host.apply_change(change);
         WorldState {
-            options,
+            config: config,
             feature_flags: Arc::new(feature_flags),
             roots: folder_roots,
             workspaces: Arc::new(workspaces),
@@ -206,13 +206,13 @@ impl WorldState {
     pub fn update_configuration(
         &mut self,
         lru_capacity: Option<usize>,
-        options: Options,
+        config: Config,
         feature_flags: FeatureFlags,
     ) {
         self.feature_flags = Arc::new(feature_flags);
         self.analysis_host.update_lru_capacity(lru_capacity);
-        self.check_watcher = create_watcher(&self.workspaces, &options);
-        self.options = options;
+        self.check_watcher = create_watcher(&self.workspaces, &config);
+        self.config = config;
     }
 
     /// Returns a vec of libraries
@@ -268,7 +268,7 @@ impl WorldState {
 
     pub fn snapshot(&self) -> WorldSnapshot {
         WorldSnapshot {
-            options: self.options.clone(),
+            config: self.config.clone(),
             feature_flags: Arc::clone(&self.feature_flags),
             workspaces: Arc::clone(&self.workspaces),
             analysis: self.analysis_host.analysis(),
diff --git a/editors/code/package-lock.json b/editors/code/package-lock.json
index 955a050666..b7220d8e20 100644
--- a/editors/code/package-lock.json
+++ b/editors/code/package-lock.json
@@ -84,9 +84,9 @@
             "dev": true
         },
         "@types/node": {
-            "version": "12.12.34",
-            "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.34.tgz",
-            "integrity": "sha512-BneGN0J9ke24lBRn44hVHNeDlrXRYF+VRp0HbSUNnEZahXGAysHZIqnf/hER6aabdBgzM4YOV4jrR8gj4Zfi0g==",
+            "version": "12.12.30",
+            "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.30.tgz",
+            "integrity": "sha512-sz9MF/zk6qVr3pAnM0BSQvYIBK44tS75QC5N+VbWSE4DjCV/pJ+UzCW/F+vVnl7TkOPcuwQureKNtSSwjBTaMg==",
             "dev": true
         },
         "@types/node-fetch": {
@@ -115,56 +115,45 @@
             "dev": true
         },
         "@typescript-eslint/eslint-plugin": {
-            "version": "2.26.0",
-            "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.26.0.tgz",
-            "integrity": "sha512-4yUnLv40bzfzsXcTAtZyTjbiGUXMrcIJcIMioI22tSOyAxpdXiZ4r7YQUU8Jj6XXrLz9d5aMHPQf5JFR7h27Nw==",
+            "version": "2.24.0",
+            "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.24.0.tgz",
+            "integrity": "sha512-wJRBeaMeT7RLQ27UQkDFOu25MqFOBus8PtOa9KaT5ZuxC1kAsd7JEHqWt4YXuY9eancX0GK9C68i5OROnlIzBA==",
             "dev": true,
             "requires": {
-                "@typescript-eslint/experimental-utils": "2.26.0",
+                "@typescript-eslint/experimental-utils": "2.24.0",
+                "eslint-utils": "^1.4.3",
                 "functional-red-black-tree": "^1.0.1",
                 "regexpp": "^3.0.0",
                 "tsutils": "^3.17.1"
             }
         },
         "@typescript-eslint/experimental-utils": {
-            "version": "2.26.0",
-            "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.26.0.tgz",
-            "integrity": "sha512-RELVoH5EYd+JlGprEyojUv9HeKcZqF7nZUGSblyAw1FwOGNnmQIU8kxJ69fttQvEwCsX5D6ECJT8GTozxrDKVQ==",
+            "version": "2.24.0",
+            "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.24.0.tgz",
+            "integrity": "sha512-DXrwuXTdVh3ycNCMYmWhUzn/gfqu9N0VzNnahjiDJvcyhfBy4gb59ncVZVxdp5XzBC77dCncu0daQgOkbvPwBw==",
             "dev": true,
             "requires": {
                 "@types/json-schema": "^7.0.3",
-                "@typescript-eslint/typescript-estree": "2.26.0",
-                "eslint-scope": "^5.0.0",
-                "eslint-utils": "^2.0.0"
-            },
-            "dependencies": {
-                "eslint-utils": {
-                    "version": "2.0.0",
-                    "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz",
-                    "integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==",
-                    "dev": true,
-                    "requires": {
-                        "eslint-visitor-keys": "^1.1.0"
-                    }
-                }
+                "@typescript-eslint/typescript-estree": "2.24.0",
+                "eslint-scope": "^5.0.0"
             }
         },
         "@typescript-eslint/parser": {
-            "version": "2.26.0",
-            "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.26.0.tgz",
-            "integrity": "sha512-+Xj5fucDtdKEVGSh9353wcnseMRkPpEAOY96EEenN7kJVrLqy/EVwtIh3mxcUz8lsFXW1mT5nN5vvEam/a5HiQ==",
+            "version": "2.24.0",
+            "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.24.0.tgz",
+            "integrity": "sha512-H2Y7uacwSSg8IbVxdYExSI3T7uM1DzmOn2COGtCahCC3g8YtM1xYAPi2MAHyfPs61VKxP/J/UiSctcRgw4G8aw==",
             "dev": true,
             "requires": {
                 "@types/eslint-visitor-keys": "^1.0.0",
-                "@typescript-eslint/experimental-utils": "2.26.0",
-                "@typescript-eslint/typescript-estree": "2.26.0",
+                "@typescript-eslint/experimental-utils": "2.24.0",
+                "@typescript-eslint/typescript-estree": "2.24.0",
                 "eslint-visitor-keys": "^1.1.0"
             }
         },
         "@typescript-eslint/typescript-estree": {
-            "version": "2.26.0",
-            "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.26.0.tgz",
-            "integrity": "sha512-3x4SyZCLB4zsKsjuhxDLeVJN6W29VwBnYpCsZ7vIdPel9ZqLfIZJgJXO47MNUkurGpQuIBALdPQKtsSnWpE1Yg==",
+            "version": "2.24.0",
+            "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.24.0.tgz",
+            "integrity": "sha512-RJ0yMe5owMSix55qX7Mi9V6z2FDuuDpN6eR5fzRJrp+8in9UF41IGNQHbg5aMK4/PjVaEQksLvz0IA8n+Mr/FA==",
             "dev": true,
             "requires": {
                 "debug": "^4.1.1",
@@ -1399,9 +1388,9 @@
             }
         },
         "rollup": {
-            "version": "2.3.1",
-            "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.3.1.tgz",
-            "integrity": "sha512-BRjzOauORe+R0U0I6SkMTSG22nYmtztR/TaBl0SvbXgc3VAxBDrZoB6HROiK0S5px1pUBnLnjBkbzmVuwC9Q1Q==",
+            "version": "2.1.0",
+            "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.1.0.tgz",
+            "integrity": "sha512-gfE1455AEazVVTJoeQtcOq/U6GSxwoj4XPSWVsuWmgIxj7sBQNLDOSA82PbdMe+cP8ql8fR1jogPFe8Wg8g4SQ==",
             "dev": true,
             "requires": {
                 "fsevents": "~2.1.2"
diff --git a/editors/code/package.json b/editors/code/package.json
index ba31c4e63d..ddc9de1ca0 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -39,13 +39,13 @@
     "devDependencies": {
         "@rollup/plugin-commonjs": "^11.0.2",
         "@rollup/plugin-node-resolve": "^7.1.1",
-        "@types/node": "^12.12.34",
+        "@types/node": "^12.12.30",
         "@types/node-fetch": "^2.5.5",
         "@types/vscode": "^1.43.0",
-        "@typescript-eslint/eslint-plugin": "^2.26.0",
-        "@typescript-eslint/parser": "^2.26.0",
+        "@typescript-eslint/eslint-plugin": "^2.24.0",
+        "@typescript-eslint/parser": "^2.24.0",
         "eslint": "^6.8.0",
-        "rollup": "^2.3.1",
+        "rollup": "^2.1.0",
         "tslib": "^1.11.1",
         "typescript": "^3.8.3",
         "typescript-formatter": "^7.2.2",
@@ -261,41 +261,57 @@
                     "default": [],
                     "description": "Paths to exclude from analysis"
                 },
-                "rust-analyzer.rustfmtArgs": {
+                "rust-analyzer.useClientWatching": {
+                    "type": "boolean",
+                    "default": true,
+                    "description": "client provided file watching instead of notify watching."
+                },
+                "rust-analyzer.rustfmt.extraArgs": {
                     "type": "array",
                     "items": {
                         "type": "string"
                     },
                     "default": [],
-                    "description": "Additional arguments to rustfmt"
+                    "markdownDescription": "Additional `cargo fmt` arguments"
                 },
-                "rust-analyzer.useClientWatching": {
+                "rust-analyzer.rustfmt.overrideCommand": {
+                    "type": "array",
+                    "items": {
+                        "type": "string"
+                    },
+                    "default": [],
+                    "markdownDescription": "Advanced option, fully override `cargo fmt` command line"
+                },
+                "rust-analyzer.checkOnSave.enable": {
                     "type": "boolean",
                     "default": true,
-                    "description": "client provided file watching instead of notify watching."
+                    "markdownDescription": "Run `cargo check` command for diagnostics on save"
+                },
+                "rust-analyzer.checkOnSave.cargoCommand": {
+                    "type": "string",
+                    "default": "check",
+                    "markdownDescription": "Cargo command to run on save"
                 },
-                "rust-analyzer.cargo-watch.enable": {
+                "rust-analyzer.checkOnSave.allTargets": {
                     "type": "boolean",
                     "default": true,
-                    "markdownDescription": "Run specified `cargo-watch` command for diagnostics on save"
+                    "markdownDescription": "Check all targets and tests (will be passed as `--all-targets`)"
                 },
-                "rust-analyzer.cargo-watch.arguments": {
+                "rust-analyzer.checkOnSave.extraArgs": {
                     "type": "array",
                     "items": {
                         "type": "string"
                     },
-                    "markdownDescription": "`cargo-watch` arguments. (e.g: `--features=\"shumway,pdf\"` will run as `cargo watch -x \"check --features=\"shumway,pdf\"\"` )",
+                    "markdownDescription": "Additional `cargo check` arguments",
                     "default": []
                 },
-                "rust-analyzer.cargo-watch.command": {
-                    "type": "string",
-                    "markdownDescription": "`cargo-watch` command. (e.g: `clippy` will run as `cargo watch -x clippy` )",
-                    "default": "check"
-                },
-                "rust-analyzer.cargo-watch.allTargets": {
-                    "type": "boolean",
-                    "markdownDescription": "Check all targets and tests (will be passed as `--all-targets`)",
-                    "default": true
+                "rust-analyzer.checkOnSave.overrideCommand": {
+                    "type": "array",
+                    "items": {
+                        "type": "string"
+                    },
+                    "default": [],
+                    "markdownDescription": "Advanced option, fully override `cargo check` command line (this must include at least `--message-format=json`)"
                 },
                 "rust-analyzer.trace.server": {
                     "type": "string",


Test patch:
diff --git a/crates/ra_ide/src/completion/test_utils.rs b/crates/ra_ide/src/completion/test_utils.rs
index 136857315c..eb90b5279c 100644
--- a/crates/ra_ide/src/completion/test_utils.rs
+++ b/crates/ra_ide/src/completion/test_utils.rs
@@ -1,19 +1,19 @@
 //! Runs completion for testing purposes.
 
 use crate::{
-    completion::{completion_item::CompletionKind, CompletionOptions},
+    completion::{completion_item::CompletionKind, CompletionConfig},
     mock_analysis::{analysis_and_position, single_file_with_position},
     CompletionItem,
 };
 
 pub(crate) fn do_completion(code: &str, kind: CompletionKind) -> Vec<CompletionItem> {
-    do_completion_with_options(code, kind, &CompletionOptions::default())
+    do_completion_with_options(code, kind, &CompletionConfig::default())
 }
 
 pub(crate) fn do_completion_with_options(
     code: &str,
     kind: CompletionKind,
-    options: &CompletionOptions,
+    options: &CompletionConfig,
 ) -> Vec<CompletionItem> {
     let (analysis, position) = if code.contains("//-") {
         analysis_and_position(code)