]> git.lizzy.rs Git - rust.git/blobdiff - crates/ra_ide_db/src/change.rs
Remove relative_path dependency
[rust.git] / crates / ra_ide_db / src / change.rs
index d8da3f949ea4162d6b182feeef2a799555037219..d1a255dcfcf7e32315163af728c5022382bb447d 100644 (file)
@@ -5,8 +5,7 @@
 
 use ra_db::{
     salsa::{Database, Durability, SweepStrategy},
-    CrateGraph, FileId, RelativePathBuf, SourceDatabase, SourceDatabaseExt, SourceRoot,
-    SourceRootId,
+    CrateGraph, FileId, SourceDatabase, SourceDatabaseExt, SourceRoot, SourceRootId,
 };
 use ra_prof::{memory_usage, profile, Bytes};
 use rustc_hash::FxHashSet;
@@ -57,14 +56,14 @@ pub fn set_crate_graph(&mut self, graph: CrateGraph) {
 #[derive(Debug)]
 struct AddFile {
     file_id: FileId,
-    path: RelativePathBuf,
+    path: String,
     text: Arc<String>,
 }
 
 #[derive(Debug)]
 struct RemoveFile {
     file_id: FileId,
-    path: RelativePathBuf,
+    path: String,
 }
 
 #[derive(Default)]
@@ -164,6 +163,15 @@ pub fn collect_garbage(&mut self) {
         hir::db::BodyQuery.in_db(self).sweep(sweep);
     }
 
+    // Feature: Memory Usage
+    //
+    // Clears rust-analyzer's internal database and prints memory usage statistics.
+    //
+    // |===
+    // | Editor  | Action Name
+    //
+    // | VS Code | **Rust Analyzer: Memory Usage (Clears Database)**
+    // |===
     pub fn per_query_memory_usage(&mut self) -> Vec<(String, Bytes)> {
         let mut acc: Vec<(String, Bytes)> = vec![];
         let sweep = SweepStrategy::default().discard_values().sweep_all_revisions();