mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-30 19:47:52 +00:00
[ty] Implement stdlib stub mapping (#19529)
by using essentially the same logic for system site-packages, on the assumption that system site-packages are always a subdir of the stdlib we were looking for.
This commit is contained in:
parent
0ec4801b0d
commit
7cc3f1ebe9
7 changed files with 495 additions and 31 deletions
|
|
@ -178,6 +178,12 @@ pub struct SearchPathSettings {
|
|||
|
||||
/// List of site packages paths to use.
|
||||
pub site_packages_paths: Vec<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.
|
||||
pub real_stdlib_path: Option<SystemPathBuf>,
|
||||
}
|
||||
|
||||
impl SearchPathSettings {
|
||||
|
|
@ -194,6 +200,7 @@ impl SearchPathSettings {
|
|||
extra_paths: vec![],
|
||||
custom_typeshed: None,
|
||||
site_packages_paths: vec![],
|
||||
real_stdlib_path: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue