19 releases (5 breaking)

0.6.1 May 10, 2020
0.5.3 Mar 16, 2020
0.5.2 Nov 26, 2019
0.2.5 Jun 19, 2019
0.2.1 Mar 26, 2019

#6 in #rust-analyzer

Download history 32/week @ 2023-12-11 33/week @ 2023-12-18 29/week @ 2023-12-25 30/week @ 2024-01-01 32/week @ 2024-01-08 32/week @ 2024-01-15 33/week @ 2024-01-22 32/week @ 2024-01-29 31/week @ 2024-02-05 38/week @ 2024-02-12 42/week @ 2024-02-19 65/week @ 2024-02-26 47/week @ 2024-03-04 49/week @ 2024-03-11 41/week @ 2024-03-18 38/week @ 2024-03-25

182 downloads per month

Apache-2.0 OR MIT

36KB
737 lines

ra_vfs

Build Status

A virtual file system abstraction for rust-analyzer.

This lives outside of the main rust-analyzer repository because we want to separate CI. VFS is hugely platform dependent, so CI for it tends to be longer and more brittle.


lib.rs:

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.

Dependencies

~1–10MB
~78K SLoC