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

ra_vfs

Virtual File System abstraction for rust-analyzer

19 releases (5 breaking)

✓ Uses Rust 2018 edition

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
Download history 1003/week @ 2020-01-25 1010/week @ 2020-02-01 1258/week @ 2020-02-08 1041/week @ 2020-02-15 911/week @ 2020-02-22 855/week @ 2020-02-29 726/week @ 2020-03-07 1101/week @ 2020-03-14 1110/week @ 2020-03-21 952/week @ 2020-03-28 924/week @ 2020-04-04 891/week @ 2020-04-11 886/week @ 2020-04-18 1216/week @ 2020-04-25 1280/week @ 2020-05-02 1297/week @ 2020-05-09

4,293 downloads per month

Apache-2.0 OR MIT

35KB
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.5MB
~27K SLoC