Struct rls_vfs::Vfs
[−]
[src]
pub struct Vfs<U = ()>(_);
Methods
impl<U> Vfs<U>
[src]
fn new() -> Vfs<U>
Creates a new, empty VFS.
fn file_saved(&self, path: &Path) -> Result<(), Error>
Indicate that the current file as known to the VFS has been written to disk.
fn flush_file(&self, path: &Path) -> Result<(), Error>
Removes a file from the VFS. Does not check if the file is synced with the disk. Does not check if the file exists.
fn file_is_synced(&self, path: &Path) -> Result<bool, Error>
fn on_changes(&self, changes: &[Change]) -> Result<(), Error>
Record a set of changes to the VFS.
fn get_cached_files(&self) -> HashMap<PathBuf, String>
Return all files in the VFS.
fn get_changes(&self) -> HashMap<PathBuf, String>
fn has_changes(&self) -> bool
Returns true if the VFS contains any changed files.
fn set_file(&self, path: &Path, text: &str)
fn load_file(&self, path: &Path) -> Result<FileContents, Error>
fn load_line(
&self,
path: &Path,
line: Row<ZeroIndexed>
) -> Result<String, Error>
&self,
path: &Path,
line: Row<ZeroIndexed>
) -> Result<String, Error>
fn load_lines(
&self,
path: &Path,
line_start: Row<ZeroIndexed>,
line_end: Row<ZeroIndexed>
) -> Result<String, Error>
&self,
path: &Path,
line_start: Row<ZeroIndexed>,
line_end: Row<ZeroIndexed>
) -> Result<String, Error>
fn load_span(&self, span: Span<ZeroIndexed>) -> Result<String, Error>
fn for_each_line<F>(&self, path: &Path, f: F) -> Result<(), Error> where
F: FnMut(&str, usize) -> Result<(), Error>,
F: FnMut(&str, usize) -> Result<(), Error>,
fn write_file(&self, path: &Path) -> Result<(), Error>
fn set_user_data(&self, path: &Path, data: Option<U>) -> Result<(), Error>
fn with_user_data<F, R>(&self, path: &Path, f: F) -> Result<R, Error> where
F: FnOnce(Result<(Option<&str>, &mut U), Error>) -> Result<R, Error>,
F: FnOnce(Result<(Option<&str>, &mut U), Error>) -> Result<R, Error>,
fn ensure_user_data<F>(&self, path: &Path, f: F) -> Result<(), Error> where
F: FnOnce(Option<&str>) -> Result<U, Error>,
F: FnOnce(Option<&str>) -> Result<U, Error>,