mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Simplify
This commit is contained in:
parent
dd5841556c
commit
5f6f994256
2 changed files with 4 additions and 8 deletions
|
@ -84,11 +84,7 @@ pub(crate) struct GlobalStateSnapshot {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl GlobalState {
|
impl GlobalState {
|
||||||
pub(crate) fn new(
|
pub(crate) fn new(sender: Sender<lsp_server::Message>, config: Config) -> GlobalState {
|
||||||
sender: Sender<lsp_server::Message>,
|
|
||||||
lru_capacity: Option<usize>,
|
|
||||||
config: Config,
|
|
||||||
) -> GlobalState {
|
|
||||||
let loader = {
|
let loader = {
|
||||||
let (sender, receiver) = unbounded::<vfs::loader::Message>();
|
let (sender, receiver) = unbounded::<vfs::loader::Message>();
|
||||||
let handle =
|
let handle =
|
||||||
|
@ -103,12 +99,13 @@ impl GlobalState {
|
||||||
Handle { handle, receiver }
|
Handle { handle, receiver }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let analysis_host = AnalysisHost::new(config.lru_capacity);
|
||||||
GlobalState {
|
GlobalState {
|
||||||
sender,
|
sender,
|
||||||
task_pool,
|
task_pool,
|
||||||
loader,
|
loader,
|
||||||
config,
|
config,
|
||||||
analysis_host: AnalysisHost::new(lru_capacity),
|
analysis_host,
|
||||||
flycheck: None,
|
flycheck: None,
|
||||||
diagnostics: Default::default(),
|
diagnostics: Default::default(),
|
||||||
mem_docs: FxHashSet::default(),
|
mem_docs: FxHashSet::default(),
|
||||||
|
|
|
@ -44,8 +44,7 @@ pub fn main_loop(config: Config, connection: Connection) -> Result<()> {
|
||||||
SetThreadPriority(thread, thread_priority_above_normal);
|
SetThreadPriority(thread, thread_priority_above_normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
GlobalState::new(connection.sender.clone(), config.lru_capacity, config)
|
GlobalState::new(connection.sender.clone(), config).run(connection.receiver)
|
||||||
.run(connection.receiver)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Event {
|
enum Event {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue