mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Module map implementation
This commit is contained in:
parent
4d8be26584
commit
b937262c9b
7 changed files with 247 additions and 47 deletions
|
@ -94,7 +94,7 @@ pub(super) fn main_loop(
|
|||
Event::Msg(msg) => {
|
||||
match msg {
|
||||
RawMsg::Request(req) => {
|
||||
if !on_request(io, &state, pool, &task_sender, req)? {
|
||||
if !on_request(io, &mut state, pool, &task_sender, req)? {
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ pub(super) fn main_loop(
|
|||
|
||||
fn on_request(
|
||||
io: &mut Io,
|
||||
world: &ServerWorldState,
|
||||
world: &mut ServerWorldState,
|
||||
pool: &ThreadPool,
|
||||
sender: &Sender<Task>,
|
||||
req: RawRequest,
|
||||
|
@ -252,7 +252,7 @@ fn on_notification(
|
|||
fn handle_request_on_threadpool<R: req::ClientRequest>(
|
||||
req: &mut Option<RawRequest>,
|
||||
pool: &ThreadPool,
|
||||
world: &ServerWorldState,
|
||||
world: &mut ServerWorldState,
|
||||
sender: &Sender<Task>,
|
||||
f: fn(ServerWorld, R::Params) -> Result<R::Result>,
|
||||
) -> Result<()>
|
||||
|
|
|
@ -86,7 +86,7 @@ impl ServerWorldState {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub fn snapshot(&self) -> ServerWorld {
|
||||
pub fn snapshot(&mut self) -> ServerWorld {
|
||||
let pm = self.path_map.clone();
|
||||
ServerWorld {
|
||||
analysis: self.analysis.snapshot(move |id, path| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue