mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
move public API to top of the file
This commit is contained in:
parent
74288ae272
commit
062aa97235
2 changed files with 8 additions and 9 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -1128,7 +1128,6 @@ dependencies = [
|
||||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"notify 4.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
"notify 4.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ra_arena 0.1.0",
|
|
||||||
"relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"tempfile 3.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"tempfile 3.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
|
|
@ -66,6 +66,14 @@ impl fmt::Debug for Vfs {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
|
pub enum VfsChange {
|
||||||
|
AddRoot { root: VfsRoot, files: Vec<(VfsFile, RelativePathBuf, Arc<String>)> },
|
||||||
|
AddFile { root: VfsRoot, file: VfsFile, path: RelativePathBuf, text: Arc<String> },
|
||||||
|
RemoveFile { root: VfsRoot, file: VfsFile, path: RelativePathBuf },
|
||||||
|
ChangeFile { file: VfsFile, text: Arc<String> },
|
||||||
|
}
|
||||||
|
|
||||||
impl Vfs {
|
impl Vfs {
|
||||||
pub fn new(roots: Vec<PathBuf>) -> (Vfs, Vec<VfsRoot>) {
|
pub fn new(roots: Vec<PathBuf>) -> (Vfs, Vec<VfsRoot>) {
|
||||||
let roots = Arc::new(Roots::new(roots));
|
let roots = Arc::new(Roots::new(roots));
|
||||||
|
@ -276,11 +284,3 @@ impl Vfs {
|
||||||
&mut self.files[file.0 as usize]
|
&mut self.files[file.0 as usize]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
|
||||||
pub enum VfsChange {
|
|
||||||
AddRoot { root: VfsRoot, files: Vec<(VfsFile, RelativePathBuf, Arc<String>)> },
|
|
||||||
AddFile { root: VfsRoot, file: VfsFile, path: RelativePathBuf, text: Arc<String> },
|
|
||||||
RemoveFile { root: VfsRoot, file: VfsFile, path: RelativePathBuf },
|
|
||||||
ChangeFile { file: VfsFile, text: Arc<String> },
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue