mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-29 19:17:20 +00:00
[ty] Use python version and path from Python extension (#19012)
This commit is contained in:
parent
26f736bc46
commit
90026047f9
22 changed files with 344 additions and 99 deletions
|
|
@ -40,22 +40,16 @@ impl SyncNotificationHandler for DidChangeTextDocumentHandler {
|
|||
.update_text_document(&key, content_changes, version)
|
||||
.with_failure_code(ErrorCode::InternalError)?;
|
||||
|
||||
match key.path() {
|
||||
let changes = match key.path() {
|
||||
AnySystemPath::System(path) => {
|
||||
let db = match session.project_db_for_path_mut(path) {
|
||||
Some(db) => db,
|
||||
None => session.default_project_db_mut(),
|
||||
};
|
||||
db.apply_changes(vec![ChangeEvent::file_content_changed(path.clone())], None);
|
||||
vec![ChangeEvent::file_content_changed(path.clone())]
|
||||
}
|
||||
AnySystemPath::SystemVirtual(virtual_path) => {
|
||||
let db = session.default_project_db_mut();
|
||||
db.apply_changes(
|
||||
vec![ChangeEvent::ChangedVirtual(virtual_path.clone())],
|
||||
None,
|
||||
);
|
||||
vec![ChangeEvent::ChangedVirtual(virtual_path.clone())]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
session.apply_changes(key.path(), changes);
|
||||
|
||||
publish_diagnostics(session, &key, client);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue