Remove canonicalization functionality from VFS and related components

- Eliminated the `canonicalize` method from the `VfsBackend` trait and its implementations in `InMemoryFs`, `NoopBackend`, and `StdBackend`, simplifying the interface and reducing complexity.
- Updated various parts of the codebase to remove references to canonicalization, including tests and prefetch cache handling, ensuring consistency across the project.
- Adjusted logging and comments to reflect the removal of path normalization logic, enhancing clarity and maintainability.

These changes aim to streamline the VFS implementation by focusing on core functionalities without the overhead of path canonicalization.
This commit is contained in:
Joe 2026-03-01 18:42:41 -06:00
parent 65f10f111c
commit fc8a6e9b9c
21 changed files with 123 additions and 440 deletions

View file

@ -42,7 +42,7 @@ pub fn snapshot_csv(
.metadata(
InstanceMetadata::new()
.instigating_source(path)
.relevant_paths(vec![vfs.canonicalize(path)?]),
.relevant_paths(vec![path.to_path_buf()]),
);
AdjacentMetadata::read_and_apply_all(vfs, path, name, &mut snapshot)?;

View file

@ -85,7 +85,7 @@ pub fn snapshot_dir_no_meta(
children
};
let normalized_path = vfs.canonicalize(path)?;
let normalized_path = path.to_path_buf();
let relevant_paths = vec![
normalized_path.clone(),
// TODO: We shouldn't need to know about Lua existing in this

View file

@ -32,7 +32,7 @@ pub fn snapshot_json(
.metadata(
InstanceMetadata::new()
.instigating_source(path)
.relevant_paths(vec![vfs.canonicalize(path)?])
.relevant_paths(vec![path.to_path_buf()])
.context(context),
);

View file

@ -53,7 +53,7 @@ pub fn snapshot_json_model(
snapshot.metadata = snapshot
.metadata
.instigating_source(path)
.relevant_paths(vec![vfs.canonicalize(path)?])
.relevant_paths(vec![path.to_path_buf()])
.context(context)
.specified_id(id)
.schema(schema)

View file

@ -72,7 +72,7 @@ pub fn snapshot_lua(
.metadata(
InstanceMetadata::new()
.instigating_source(path)
.relevant_paths(vec![vfs.canonicalize(path)?])
.relevant_paths(vec![path.to_path_buf()])
.context(context),
);

View file

@ -147,10 +147,7 @@ pub fn snapshot_project(
// We SHOULD NOT mark the project file as a relevant path for any
// nodes that aren't roots. They'll be updated as part of the project
// file being updated.
snapshot
.metadata
.relevant_paths
.push(vfs.canonicalize(path)?);
snapshot.metadata.relevant_paths.push(path.to_path_buf());
Ok(Some(snapshot))
}

View file

@ -30,7 +30,7 @@ pub fn snapshot_rbxm(
.metadata(
InstanceMetadata::new()
.instigating_source(path)
.relevant_paths(vec![vfs.canonicalize(path)?])
.relevant_paths(vec![path.to_path_buf()])
.context(context),
);

View file

@ -33,7 +33,7 @@ pub fn snapshot_rbxmx(
.metadata(
InstanceMetadata::new()
.instigating_source(path)
.relevant_paths(vec![vfs.canonicalize(path)?])
.relevant_paths(vec![path.to_path_buf()])
.context(context),
);

View file

@ -33,7 +33,7 @@ pub fn snapshot_toml(
.metadata(
InstanceMetadata::new()
.instigating_source(path)
.relevant_paths(vec![vfs.canonicalize(path)?])
.relevant_paths(vec![path.to_path_buf()])
.context(context),
);

View file

@ -28,7 +28,7 @@ pub fn snapshot_txt(
.metadata(
InstanceMetadata::new()
.instigating_source(path)
.relevant_paths(vec![vfs.canonicalize(path)?])
.relevant_paths(vec![path.to_path_buf()])
.context(context),
);

View file

@ -37,7 +37,7 @@ pub fn snapshot_yaml(
.metadata(
InstanceMetadata::new()
.instigating_source(path)
.relevant_paths(vec![vfs.canonicalize(path)?])
.relevant_paths(vec![path.to_path_buf()])
.context(context),
);