mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00

The previous way of sending from the thread pool suffered from stale diagnostics due to being canceled before we could clear the old ones. The key change is moving to sending diagnostics from the main loop thread, but doing all the hard work in the thread pool. This should provide the best of both worlds, with little to no of the downsides. This should hopefully fix a lot of issues, but we'll need testing in each individual issue to be sure.
41 lines
943 B
Rust
41 lines
943 B
Rust
//! Implementation of the LSP for rust-analyzer.
|
|
//!
|
|
//! This crate takes Rust-specific analysis results from ra_ide and
|
|
//! translates into LSP types.
|
|
//!
|
|
//! It also is the root of all state. `world` module defines the bulk of the
|
|
//! state, and `main_loop` module defines the rules for modifying it.
|
|
#![recursion_limit = "512"]
|
|
|
|
#[allow(unused)]
|
|
macro_rules! println {
|
|
($($tt:tt)*) => {
|
|
compile_error!("stdout is locked, use eprintln")
|
|
};
|
|
}
|
|
|
|
#[allow(unused)]
|
|
macro_rules! print {
|
|
($($tt:tt)*) => {
|
|
compile_error!("stdout is locked, use eprint")
|
|
};
|
|
}
|
|
|
|
mod caps;
|
|
mod cargo_target_spec;
|
|
mod conv;
|
|
mod main_loop;
|
|
mod markdown;
|
|
pub mod req;
|
|
mod config;
|
|
mod world;
|
|
mod diagnostics;
|
|
|
|
pub type Result<T> = std::result::Result<T, Box<dyn std::error::Error + Send + Sync>>;
|
|
pub use crate::{
|
|
caps::server_capabilities,
|
|
config::ServerConfig,
|
|
main_loop::LspError,
|
|
main_loop::{main_loop, show_message},
|
|
};
|