Conversation
|
7cb5f50 to
f969d0d
Compare
There was a problem hiding this comment.
I admit, adding countme fields to the different tracked structs isn't directly related to this PR but it seemed useful to have and it's a local enough change. But I can extract it if it is preferred.
|
|
||
| /// Paths that should be watched but setting up the watcher failed for some reason. | ||
| /// This should be rare. | ||
| errored_paths: Vec<SystemPathBuf>, |
There was a problem hiding this comment.
I use a Vec here because this should almost always be empty and searching small vecs tends to be faster than hash maps, not that it matters much 😆
CodSpeed Performance ReportMerging #12407 will not alter performanceComparing Summary
|
f969d0d to
d5ba5ce
Compare
AlexWaygood
left a comment
There was a problem hiding this comment.
The module-resolver crate bits look good (haven't looked at the other bits yet, but I will!)
| use crate::resolver::{module_resolution_settings, SearchPathIterator}; | ||
| pub use db::{Db, Jar}; | ||
| pub use module::{Module, ModuleKind}; | ||
| pub use module_name::ModuleName; | ||
| pub use resolver::resolve_module; | ||
| use ruff_db::system::SystemPath; | ||
| use std::iter::FusedIterator; | ||
| pub use typeshed::{ | ||
| vendored_typeshed_stubs, TypeshedVersionsParseError, TypeshedVersionsParseErrorKind, | ||
| }; |
There was a problem hiding this comment.
nit: this is inconsistent with the import style I've used for the rest of this crate
| use crate::resolver::{module_resolution_settings, SearchPathIterator}; | |
| pub use db::{Db, Jar}; | |
| pub use module::{Module, ModuleKind}; | |
| pub use module_name::ModuleName; | |
| pub use resolver::resolve_module; | |
| use ruff_db::system::SystemPath; | |
| use std::iter::FusedIterator; | |
| pub use typeshed::{ | |
| vendored_typeshed_stubs, TypeshedVersionsParseError, TypeshedVersionsParseErrorKind, | |
| }; | |
| use std::iter::FusedIterator; | |
| use ruff_db::system::SystemPath; | |
| pub use db::{Db, Jar}; | |
| pub use module::{Module, ModuleKind}; | |
| pub use module_name::ModuleName; | |
| use resolver::{module_resolution_settings, SearchPathIterator}; | |
| pub use resolver::resolve_module; | |
| pub use typeshed::{ | |
| vendored_typeshed_stubs, TypeshedVersionsParseError, TypeshedVersionsParseErrorKind, | |
| }; |
There was a problem hiding this comment.
I think we should either deploy tooling to standardize use sorting or not be opinionated about it. It otherwise is guaranteed to get out of sync.
There was a problem hiding this comment.
Fair enough, I'll try to be less picky about it in the future :(
There was a problem hiding this comment.
FWIW I'd be happy to have tooling that standardizes it, but I haven't looked into what the options are.
There was a problem hiding this comment.
Rustfmt has an option for it but it isn't stabilized. https://rust-lang.github.io/rustfmt/?version=master&search=import#group_imports and it can't be enabled on non-nigthly rustfmt
Warning: can't set `group_imports = StdExternalCrate`, unstable features are only available in nightly channel.
Warning: can't set `unstable_features = true`, unstable features are only available in nightly channel.
d5ba5ce to
98a3959
Compare
98a3959 to
b396613
Compare
Summary
This PR extends the CLI to watch not only the workspace root but also all search paths. The watcher automatically registers new search paths or stops watching search paths when the program's
SearchPathSettingschange.Test Plan
Added integration tests.