Struct Config

Source
pub struct Config { /* private fields */ }

Implementations§

Source§

impl Config

Source

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.

Source

pub fn same_source_root_parent_map( &self, other: &Arc<FxHashMap<SourceRootId, SourceRootId>>, ) -> bool

Source

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.

Source

pub fn add_discovered_project_from_command( &mut self, data: ProjectJsonData, buildfile: AbsPathBuf, )

Source§

impl Config

Source

pub fn new( root_path: AbsPathBuf, caps: ClientCapabilities, workspace_roots: Vec<AbsPathBuf>, client_info: Option<ClientInfo>, ) -> Self

Source

pub fn rediscover_workspaces(&mut self)

Source

pub fn remove_workspace(&mut self, path: &AbsPath)

Source

pub fn add_workspaces(&mut self, paths: impl Iterator<Item = AbsPathBuf>)

Source

pub fn json_schema() -> Value

Source

pub fn root_path(&self) -> &AbsPathBuf

Source

pub fn caps(&self) -> &ClientCapabilities

Source§

impl Config

Source

pub fn assist(&self, source_root: Option<SourceRootId>) -> AssistConfig

Source

pub fn call_hierarchy(&self) -> CallHierarchyConfig

Source

pub fn completion( &self, source_root: Option<SourceRootId>, ) -> CompletionConfig<'_>

Source

pub fn completion_hide_deprecated(&self) -> bool

Source

pub fn detached_files(&self) -> &Vec<AbsPathBuf>

Source

pub fn diagnostics( &self, source_root: Option<SourceRootId>, ) -> DiagnosticsConfig

Source

pub fn expand_proc_attr_macros(&self) -> bool

Source

pub fn hover_actions(&self) -> HoverActionsConfig

Source

pub fn hover(&self) -> HoverConfig

Source

pub fn inlay_hints(&self) -> InlayHintsConfig

Source

pub fn join_lines(&self) -> JoinLinesConfig

Source

pub fn highlighting_non_standard_tokens(&self) -> bool

Source

pub fn highlighting_config(&self) -> HighlightConfig

Source

pub fn has_linked_projects(&self) -> bool

Source

pub fn linked_manifests(&self) -> impl Iterator<Item = &Utf8Path> + '_

Source

pub fn has_linked_project_jsons(&self) -> bool

Source

pub fn discover_workspace_config(&self) -> Option<&DiscoverWorkspaceConfig>

Source

pub fn linked_or_discovered_projects(&self) -> Vec<LinkedProject>

Source

pub fn prefill_caches(&self) -> bool

Source

pub fn publish_diagnostics(&self, source_root: Option<SourceRootId>) -> bool

Source

pub fn diagnostics_map( &self, source_root: Option<SourceRootId>, ) -> DiagnosticsMapConfig

Source

pub fn extra_args(&self, source_root: Option<SourceRootId>) -> &Vec<String>

Source

pub fn extra_env( &self, source_root: Option<SourceRootId>, ) -> &FxHashMap<String, String>

Source

pub fn check_extra_args(&self, source_root: Option<SourceRootId>) -> Vec<String>

Source

pub fn check_extra_env( &self, source_root: Option<SourceRootId>, ) -> FxHashMap<String, String>

Source

pub fn lru_parse_query_capacity(&self) -> Option<u16>

Source

pub fn lru_query_capacities_config(&self) -> Option<&FxHashMap<Box<str>, u16>>

Source

pub fn proc_macro_srv(&self) -> Option<AbsPathBuf>

Source

pub fn ignored_proc_macros( &self, source_root: Option<SourceRootId>, ) -> &FxHashMap<Box<str>, Box<[Box<str>]>>

Source

pub fn expand_proc_macros(&self) -> bool

Source

pub fn files(&self) -> FilesConfig

Source

pub fn excluded(&self) -> impl Iterator<Item = AbsPathBuf> + use<'_>

Source

pub fn notifications(&self) -> NotificationsConfig

Source

pub fn cargo_autoreload_config(&self, source_root: Option<SourceRootId>) -> bool

Source

pub fn run_build_scripts(&self, source_root: Option<SourceRootId>) -> bool

Source

pub fn cargo(&self, source_root: Option<SourceRootId>) -> CargoConfig

Source

pub fn cfg_set_test(&self, source_root: Option<SourceRootId>) -> bool

Source

pub fn rustfmt(&self, source_root_id: Option<SourceRootId>) -> RustfmtConfig

Source

pub fn flycheck_workspace(&self, source_root: Option<SourceRootId>) -> bool

Source

pub fn check_on_save(&self, source_root: Option<SourceRootId>) -> bool

Source

pub fn script_rebuild_on_save(&self, source_root: Option<SourceRootId>) -> bool

Source

pub fn runnables(&self, source_root: Option<SourceRootId>) -> RunnablesConfig

Source

pub fn find_all_refs_exclude_imports(&self) -> bool

Source

pub fn find_all_refs_exclude_tests(&self) -> bool

Source

pub fn snippet_cap(&self) -> Option<SnippetCap>

Source

pub fn call_info(&self) -> CallInfoConfig

Source

pub fn lens(&self) -> LensConfig

Source

pub fn workspace_symbol( &self, source_root: Option<SourceRootId>, ) -> WorkspaceSymbolConfig

Source

pub fn client_commands(&self) -> ClientCommandsConfig

Source

pub fn prime_caches_num_threads(&self) -> usize

Source

pub fn main_loop_num_threads(&self) -> usize

Source

pub fn typing_trigger_chars(&self) -> &str

Source

pub fn visual_studio_code_version(&self) -> Option<&Version>

Source

pub fn client_is_helix(&self) -> bool

Source

pub fn client_is_neovim(&self) -> bool

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for Config

Source§

type Target = ClientCapabilities

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsAny for T
where T: Any,

§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Cast for T

§

fn cast<U>(self, interner: <U as HasInterner>::Interner) -> U
where Self: CastTo<U>, U: HasInterner,

Cast a value to type U using CastTo.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoBox<dyn Any> for T
where T: Any,

§

fn into_box(self) -> Box<dyn Any>

Convert self into the appropriate boxed form.
§

impl<T> IntoBox<dyn Any + Send> for T
where T: Any + Send,

§

fn into_box(self) -> Box<dyn Any + Send>

Convert self into the appropriate boxed form.
§

impl<T> IntoBox<dyn Any + Sync + Send> for T
where T: Any + Send + Sync,

§

fn into_box(self) -> Box<dyn Any + Sync + Send>

Convert self into the appropriate boxed form.
Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Lookup<T> for T

§

fn into_owned(self) -> T

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<'a, T> Captures<'a> for T
where T: ?Sized,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T