[ty] Move search path resolution to Options::to_program_settings (#18937)

This commit is contained in:
Micha Reiser 2025-06-25 18:00:38 +02:00 committed by GitHub
parent 8b22992988
commit 5d546c600a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 481 additions and 549 deletions

View file

@ -1,7 +1,6 @@
use std::any::Any;
use js_sys::{Error, JsString};
use ruff_db::Upcast;
use ruff_db::diagnostic::{self, DisplayDiagnosticConfig};
use ruff_db::files::{File, FileRange, system_path_to_file};
use ruff_db::source::{line_index, source_text};
@ -10,6 +9,7 @@ use ruff_db::system::{
CaseSensitivity, DirectoryEntry, GlobError, MemoryFileSystem, Metadata, PatternError, System,
SystemPath, SystemPathBuf, SystemVirtualPath,
};
use ruff_db::{Db as _, Upcast};
use ruff_notebook::Notebook;
use ruff_python_formatter::formatted_file;
use ruff_source_file::{LineIndex, OneIndexed, SourceLocation};
@ -97,10 +97,10 @@ impl Workspace {
)
.map_err(into_error)?;
let program_settings = project.to_program_settings(&self.system);
Program::get(&self.db)
.update_from_settings(&mut self.db, program_settings)
let program_settings = project
.to_program_settings(&self.system, self.db.vendored())
.map_err(into_error)?;
Program::get(&self.db).update_from_settings(&mut self.db, program_settings);
self.db.project().reload(&mut self.db, project);