mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-28 02:39:59 +00:00
[ty] Support LSP go-to with vendored typeshed stubs (#19057)
## Summary Extracts the vendored typeshed stubs lazily and caches them on the local filesystem to support go-to in the LSP. Resolves https://github.com/astral-sh/ty/issues/77.
This commit is contained in:
parent
f7fc8fb084
commit
ebc70a4002
12 changed files with 200 additions and 11 deletions
|
|
@ -8,7 +8,7 @@ use ruff_db::source::{line_index, source_text};
|
|||
use ruff_db::system::walk_directory::WalkDirectoryBuilder;
|
||||
use ruff_db::system::{
|
||||
CaseSensitivity, DirectoryEntry, GlobError, MemoryFileSystem, Metadata, PatternError, System,
|
||||
SystemPath, SystemPathBuf, SystemVirtualPath,
|
||||
SystemPath, SystemPathBuf, SystemVirtualPath, WritableSystem,
|
||||
};
|
||||
use ruff_notebook::Notebook;
|
||||
use ruff_python_formatter::formatted_file;
|
||||
|
|
@ -695,6 +695,10 @@ impl System for WasmSystem {
|
|||
None
|
||||
}
|
||||
|
||||
fn cache_dir(&self) -> Option<SystemPathBuf> {
|
||||
None
|
||||
}
|
||||
|
||||
fn read_directory<'a>(
|
||||
&'a self,
|
||||
path: &SystemPath,
|
||||
|
|
@ -715,6 +719,10 @@ impl System for WasmSystem {
|
|||
Ok(Box::new(self.fs.glob(pattern)?))
|
||||
}
|
||||
|
||||
fn as_writable(&self) -> Option<&dyn WritableSystem> {
|
||||
None
|
||||
}
|
||||
|
||||
fn as_any(&self) -> &dyn Any {
|
||||
self
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue