pub struct SearchPathSettings {
pub extra_paths: Vec<SystemPathBuf>,
pub src_roots: Vec<SystemPathBuf>,
pub custom_typeshed: Option<SystemPathBuf>,
pub site_packages_paths: Vec<SystemPathBuf>,
pub real_stdlib_path: Option<SystemPathBuf>,
}Expand description
Configures the search paths for module resolution.
Fields§
§extra_paths: Vec<SystemPathBuf>List of user-provided paths that should take first priority in the module resolution. Examples in other type checkers are mypy’s MYPYPATH environment variable, or pyright’s stubPath configuration setting.
src_roots: Vec<SystemPathBuf>The root of the project, used for finding first-party modules.
custom_typeshed: Option<SystemPathBuf>Optional path to a “custom typeshed” directory on disk for us to use for standard-library types. If this is not provided, we will fallback to our vendored typeshed stubs for the stdlib, bundled as a zip file in the binary
site_packages_paths: Vec<SystemPathBuf>List of site packages paths to use.
real_stdlib_path: Option<SystemPathBuf>Option path to the real stdlib on the system, and not some instance of typeshed.
We should ideally only ever use this for things like goto-definition, where typeshed isn’t the right answer.
Implementations§
Source§impl SearchPathSettings
impl SearchPathSettings
pub fn new(src_roots: Vec<SystemPathBuf>) -> Self
pub fn empty() -> Self
pub fn to_search_paths<Strategy: MisconfigurationStrategy>( &self, system: &dyn System, vendored: &VendoredFileSystem, strategy: &Strategy, ) -> Result<SearchPaths, Strategy::Error<SearchPathSettingsError>>
Trait Implementations§
Source§impl Clone for SearchPathSettings
impl Clone for SearchPathSettings
Source§fn clone(&self) -> SearchPathSettings
fn clone(&self) -> SearchPathSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SearchPathSettings
impl Debug for SearchPathSettings
impl Eq for SearchPathSettings
Source§impl PartialEq for SearchPathSettings
impl PartialEq for SearchPathSettings
impl StructuralPartialEq for SearchPathSettings
Auto Trait Implementations§
impl Freeze for SearchPathSettings
impl RefUnwindSafe for SearchPathSettings
impl Send for SearchPathSettings
impl Sync for SearchPathSettings
impl Unpin for SearchPathSettings
impl UnsafeUnpin for SearchPathSettings
impl UnwindSafe for SearchPathSettings
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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> ⓘ
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