X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=crates%2Frust-analyzer%2Fsrc%2Fconfig.rs;h=5826b6b114c2b455e68eab0d2a08e4b5eacf5f74;hb=a68ce62f6a33d3e5777c1d64c946e0f1d9c7f457;hp=81f4ccd365c3aca1288d0b942aa247f1813367ef;hpb=53b5b2fdaa071d96edec4d840e0d9682f6794d1a;p=rust.git diff --git a/crates/rust-analyzer/src/config.rs b/crates/rust-analyzer/src/config.rs index 81f4ccd365c..5826b6b114c 100644 --- a/crates/rust-analyzer/src/config.rs +++ b/crates/rust-analyzer/src/config.rs @@ -58,6 +58,9 @@ struct ConfigData { /// Whether to allow import insertion to merge new imports into single path glob imports like `use std::fmt::*;`. assist_allowMergingIntoGlobImports: bool = "true", + /// Warm up caches on project load. + cache_warmup: bool = "true", + /// Show function name and docs in parameter hints. callInfo_full: bool = "true", @@ -195,14 +198,16 @@ struct ConfigData { hoverActions_run: bool = "true", /// Whether to show inlay type hints for method chains. - inlayHints_chainingHints: bool = "true", + inlayHints_chainingHints: bool = "true", /// Maximum length for inlay hints. Set to null to have an unlimited length. - inlayHints_maxLength: Option = "25", + inlayHints_maxLength: Option = "25", /// Whether to show function parameter name inlay hints at the call /// site. - inlayHints_parameterHints: bool = "true", + inlayHints_parameterHints: bool = "true", /// Whether to show inlay type hints for variables. - inlayHints_typeHints: bool = "true", + inlayHints_typeHints: bool = "true", + /// Whether to hide inlay hints for constructors. + inlayHints_hideNamedConstructorHints: bool = "false", /// Join lines inserts else between consecutive ifs. joinLines_joinElseIf: bool = "true", @@ -543,6 +548,10 @@ pub fn did_change_watched_files_dynamic_registration(&self) -> bool { ) } + pub fn prefill_caches(&self) -> bool { + self.data.cache_warmup + } + pub fn location_link(&self) -> bool { try_or!(self.caps.text_document.as_ref()?.definition?.link_support?, false) } @@ -768,6 +777,7 @@ pub fn inlay_hints(&self) -> InlayHintsConfig { type_hints: self.data.inlayHints_typeHints, parameter_hints: self.data.inlayHints_parameterHints, chaining_hints: self.data.inlayHints_chainingHints, + hide_named_constructor_hints: self.data.inlayHints_hideNamedConstructorHints, max_length: self.data.inlayHints_maxLength, } }