mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 22:01:47 +00:00
red-knot: Add a method to resolve a file for an arbitrary VfsPath
(#11826)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
13ad24b13e
commit
98b13b9844
4 changed files with 75 additions and 59 deletions
|
@ -63,7 +63,7 @@ mod tests {
|
|||
use crate::file_system::FileSystemPath;
|
||||
use crate::source::{line_index, source_text};
|
||||
use crate::tests::TestDb;
|
||||
use crate::Db;
|
||||
use crate::vfs::system_path_to_file;
|
||||
|
||||
#[test]
|
||||
fn re_runs_query_when_file_revision_changes() -> crate::file_system::Result<()> {
|
||||
|
@ -73,7 +73,7 @@ mod tests {
|
|||
db.file_system_mut()
|
||||
.write_file(path, "x = 10".to_string())?;
|
||||
|
||||
let file = db.file(path);
|
||||
let file = system_path_to_file(&db, path).unwrap();
|
||||
|
||||
assert_eq!(&*source_text(&db, file), "x = 10");
|
||||
|
||||
|
@ -95,7 +95,7 @@ mod tests {
|
|||
db.file_system_mut()
|
||||
.write_file(path, "x = 10".to_string())?;
|
||||
|
||||
let file = db.file(path);
|
||||
let file = system_path_to_file(&db, path).unwrap();
|
||||
|
||||
assert_eq!(&*source_text(&db, file), "x = 10");
|
||||
|
||||
|
@ -122,7 +122,7 @@ mod tests {
|
|||
db.file_system_mut()
|
||||
.write_file(path, "x = 10\ny = 20".to_string())?;
|
||||
|
||||
let file = db.file(path);
|
||||
let file = system_path_to_file(&db, path).unwrap();
|
||||
let index = line_index(&db, file);
|
||||
let text = source_text(&db, file);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue