mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-16 17:58:16 +00:00
Merge #9793
9793: Remove unused structs in ide_db r=matklad a=michalmuskala Co-authored-by: Michał Muskała <michal@muskala.eu>
This commit is contained in:
commit
a16b06afa7
1 changed files with 2 additions and 30 deletions
|
@ -1,44 +1,16 @@
|
||||||
//! Applies changes to the IDE state transactionally.
|
//! Applies changes to the IDE state transactionally.
|
||||||
|
|
||||||
use std::{fmt, sync::Arc};
|
use std::sync::Arc;
|
||||||
|
|
||||||
use base_db::{
|
use base_db::{
|
||||||
salsa::{Database, Durability, SweepStrategy},
|
salsa::{Database, Durability, SweepStrategy},
|
||||||
Change, FileId, SourceRootId,
|
Change, SourceRootId,
|
||||||
};
|
};
|
||||||
use profile::{memory_usage, Bytes};
|
use profile::{memory_usage, Bytes};
|
||||||
use rustc_hash::FxHashSet;
|
use rustc_hash::FxHashSet;
|
||||||
|
|
||||||
use crate::{symbol_index::SymbolsDatabase, RootDatabase};
|
use crate::{symbol_index::SymbolsDatabase, RootDatabase};
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
struct AddFile {
|
|
||||||
file_id: FileId,
|
|
||||||
path: String,
|
|
||||||
text: Arc<String>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
struct RemoveFile {
|
|
||||||
file_id: FileId,
|
|
||||||
path: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Default)]
|
|
||||||
struct RootChange {
|
|
||||||
added: Vec<AddFile>,
|
|
||||||
removed: Vec<RemoveFile>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl fmt::Debug for RootChange {
|
|
||||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
|
||||||
fmt.debug_struct("RootChange")
|
|
||||||
.field("added", &self.added.len())
|
|
||||||
.field("removed", &self.removed.len())
|
|
||||||
.finish()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl RootDatabase {
|
impl RootDatabase {
|
||||||
pub fn request_cancellation(&mut self) {
|
pub fn request_cancellation(&mut self) {
|
||||||
let _p = profile::span("RootDatabase::request_cancellation");
|
let _p = profile::span("RootDatabase::request_cancellation");
|
||||||
|
|
Loading…
Reference in a new issue