pub struct Config { /* private fields */ }
Implementations§
Source§impl Config
impl Config
Sourcepub fn user_config_dir_path() -> Option<AbsPathBuf>
pub fn user_config_dir_path() -> Option<AbsPathBuf>
Path to the user configuration dir. This can be seen as a generic way to define what would be $XDG_CONFIG_HOME/rust-analyzer
in Linux.
pub fn same_source_root_parent_map( &self, other: &Arc<FxHashMap<SourceRootId, SourceRootId>>, ) -> bool
Sourcepub fn apply_change(&self, change: ConfigChange) -> (Config, ConfigErrors, bool)
pub fn apply_change(&self, change: ConfigChange) -> (Config, ConfigErrors, bool)
Given change
this generates a new Config
, thereby collecting errors of type ConfigError
.
If there are changes that have global/client level effect, the last component of the return type
will be set to true
, which should be used by the GlobalState
to update itself.
pub fn add_discovered_project_from_command( &mut self, data: ProjectJsonData, buildfile: AbsPathBuf, )
Source§impl Config
impl Config
pub fn new( root_path: AbsPathBuf, caps: ClientCapabilities, workspace_roots: Vec<AbsPathBuf>, client_info: Option<ClientInfo>, ) -> Self
pub fn rediscover_workspaces(&mut self)
pub fn remove_workspace(&mut self, path: &AbsPath)
pub fn add_workspaces(&mut self, paths: impl Iterator<Item = AbsPathBuf>)
pub fn json_schema() -> Value
pub fn root_path(&self) -> &AbsPathBuf
pub fn caps(&self) -> &ClientCapabilities
Source§impl Config
impl Config
pub fn assist(&self, source_root: Option<SourceRootId>) -> AssistConfig
pub fn call_hierarchy(&self) -> CallHierarchyConfig
pub fn completion( &self, source_root: Option<SourceRootId>, ) -> CompletionConfig<'_>
pub fn completion_hide_deprecated(&self) -> bool
pub fn detached_files(&self) -> &Vec<AbsPathBuf>
pub fn diagnostics( &self, source_root: Option<SourceRootId>, ) -> DiagnosticsConfig
pub fn expand_proc_attr_macros(&self) -> bool
pub fn hover_actions(&self) -> HoverActionsConfig
pub fn hover(&self) -> HoverConfig
pub fn inlay_hints(&self) -> InlayHintsConfig
pub fn join_lines(&self) -> JoinLinesConfig
pub fn highlighting_non_standard_tokens(&self) -> bool
pub fn highlighting_config(&self) -> HighlightConfig
pub fn has_linked_projects(&self) -> bool
pub fn linked_manifests(&self) -> impl Iterator<Item = &Utf8Path> + '_
pub fn has_linked_project_jsons(&self) -> bool
pub fn discover_workspace_config(&self) -> Option<&DiscoverWorkspaceConfig>
pub fn linked_or_discovered_projects(&self) -> Vec<LinkedProject>
pub fn prefill_caches(&self) -> bool
pub fn publish_diagnostics(&self, source_root: Option<SourceRootId>) -> bool
pub fn diagnostics_map( &self, source_root: Option<SourceRootId>, ) -> DiagnosticsMapConfig
pub fn extra_args(&self, source_root: Option<SourceRootId>) -> &Vec<String>
pub fn extra_env( &self, source_root: Option<SourceRootId>, ) -> &FxHashMap<String, String>
pub fn check_extra_args(&self, source_root: Option<SourceRootId>) -> Vec<String>
pub fn check_extra_env( &self, source_root: Option<SourceRootId>, ) -> FxHashMap<String, String>
pub fn lru_parse_query_capacity(&self) -> Option<u16>
pub fn lru_query_capacities_config(&self) -> Option<&FxHashMap<Box<str>, u16>>
pub fn proc_macro_srv(&self) -> Option<AbsPathBuf>
pub fn ignored_proc_macros( &self, source_root: Option<SourceRootId>, ) -> &FxHashMap<Box<str>, Box<[Box<str>]>>
pub fn expand_proc_macros(&self) -> bool
pub fn files(&self) -> FilesConfig
pub fn excluded(&self) -> impl Iterator<Item = AbsPathBuf> + use<'_>
pub fn notifications(&self) -> NotificationsConfig
pub fn cargo_autoreload_config(&self, source_root: Option<SourceRootId>) -> bool
pub fn run_build_scripts(&self, source_root: Option<SourceRootId>) -> bool
pub fn cargo(&self, source_root: Option<SourceRootId>) -> CargoConfig
pub fn cfg_set_test(&self, source_root: Option<SourceRootId>) -> bool
pub fn rustfmt(&self, source_root_id: Option<SourceRootId>) -> RustfmtConfig
pub fn flycheck_workspace(&self, source_root: Option<SourceRootId>) -> bool
pub fn check_on_save(&self, source_root: Option<SourceRootId>) -> bool
pub fn script_rebuild_on_save(&self, source_root: Option<SourceRootId>) -> bool
pub fn runnables(&self, source_root: Option<SourceRootId>) -> RunnablesConfig
pub fn find_all_refs_exclude_imports(&self) -> bool
pub fn find_all_refs_exclude_tests(&self) -> bool
pub fn snippet_cap(&self) -> Option<SnippetCap>
pub fn call_info(&self) -> CallInfoConfig
pub fn lens(&self) -> LensConfig
pub fn workspace_symbol( &self, source_root: Option<SourceRootId>, ) -> WorkspaceSymbolConfig
pub fn client_commands(&self) -> ClientCommandsConfig
pub fn prime_caches_num_threads(&self) -> usize
pub fn main_loop_num_threads(&self) -> usize
pub fn typing_trigger_chars(&self) -> &str
pub fn visual_studio_code_version(&self) -> Option<&Version>
pub fn client_is_helix(&self) -> bool
pub fn client_is_neovim(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl !RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl !UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Cast for T
impl<T> Cast for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more