#vfs #ci #analyzer #file #virtual #virtual-file-system

ra_vfs

Virtual File System abstraction for rust-analyzer

15 releases (4 breaking)

✓ Uses Rust 2018 edition

new 0.5.1 Nov 7, 2019
0.4.0 Sep 6, 2019
0.2.5 Jun 19, 2019
0.2.1 Mar 26, 2019
Download history 171/week @ 2019-07-25 169/week @ 2019-08-01 256/week @ 2019-08-08 426/week @ 2019-08-15 618/week @ 2019-08-22 396/week @ 2019-08-29 501/week @ 2019-09-05 438/week @ 2019-09-12 378/week @ 2019-09-19 305/week @ 2019-09-26 264/week @ 2019-10-03 239/week @ 2019-10-10 720/week @ 2019-10-17 733/week @ 2019-10-24 620/week @ 2019-10-31

1,960 downloads per month

Apache-2.0 OR MIT

35KB
729 lines

ra_vfs

Build Status

A virtual file system abstraction for rust-analyzer.

This lives outside of the main rust-analyzer repository because we 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.5MB
~29K SLoC