Expand description
VFS stands for Virtual File System.
When doing analysis, we don’t want to do any IO, we want to keep all source code in memory. However, the actual source code is stored on disk, so you need to get it into the memory in the first place somehow. VFS is the component which does this.
It is also responsible for watching the disk for changes, and for merging editor state (modified, unsaved files) with disk state.
TODO: Some LSP clients support watching the disk, so this crate should to support custom watcher events (related to https://github.com/rust-analyzer/rust-analyzer/issues/131)
VFS is based on a concept of roots: a set of directories on the file system which are watched for changes. Typically, there will be a root for each Cargo package.
Structs§
- Relative
Path - A borrowed, immutable relative path.
- Relative
Path Buf - An owned, mutable relative path.
- Root
Entry - RootEntry identifies a root folder with a given filter used to determine whether to include or exclude files and folders under it.
- Vfs
- VfsFile
- VfsRoot
- VfsRoot identifies a watched directory on the file system.
- VfsTask
- Opaque wrapper around file-system event.
- Watch
Enums§
Traits§
- Filter
- a
Filter
is used to determine whether a file or a folder under the specific root is included.
Functions§
- normalize_
newlines - Replaces
\r\n
with\n
in-place insrc
.