Post-rebase fixes
This commit is contained in:
parent
3445bc42b6
commit
652909cdba
6 changed files with 55 additions and 46 deletions
|
@ -7895,6 +7895,14 @@ async fn test_mutual_editor_inlay_hint_cache_update(
|
||||||
let workspace_a = client_a.build_workspace(&project_a, cx_a);
|
let workspace_a = client_a.build_workspace(&project_a, cx_a);
|
||||||
cx_a.foreground().start_waiting();
|
cx_a.foreground().start_waiting();
|
||||||
|
|
||||||
|
let _buffer_a = project_a
|
||||||
|
.update(cx_a, |project, cx| {
|
||||||
|
project.open_local_buffer("/a/main.rs", cx)
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
let fake_language_server = fake_language_servers.next().await.unwrap();
|
||||||
|
let next_call_id = Arc::new(AtomicU32::new(0));
|
||||||
let editor_a = workspace_a
|
let editor_a = workspace_a
|
||||||
.update(cx_a, |workspace, cx| {
|
.update(cx_a, |workspace, cx| {
|
||||||
workspace.open_path((worktree_id, "main.rs"), None, true, cx)
|
workspace.open_path((worktree_id, "main.rs"), None, true, cx)
|
||||||
|
@ -7903,9 +7911,6 @@ async fn test_mutual_editor_inlay_hint_cache_update(
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.downcast::<Editor>()
|
.downcast::<Editor>()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let fake_language_server = fake_language_servers.next().await.unwrap();
|
|
||||||
let next_call_id = Arc::new(AtomicU32::new(0));
|
|
||||||
fake_language_server
|
fake_language_server
|
||||||
.handle_request::<lsp::request::InlayHintRequest, _, _>(move |params, _| {
|
.handle_request::<lsp::request::InlayHintRequest, _, _>(move |params, _| {
|
||||||
let task_next_call_id = Arc::clone(&next_call_id);
|
let task_next_call_id = Arc::clone(&next_call_id);
|
||||||
|
@ -7938,6 +7943,7 @@ async fn test_mutual_editor_inlay_hint_cache_update(
|
||||||
.next()
|
.next()
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
cx_a.foreground().finish_waiting();
|
cx_a.foreground().finish_waiting();
|
||||||
cx_a.foreground().run_until_parked();
|
cx_a.foreground().run_until_parked();
|
||||||
|
|
||||||
|
|
|
@ -851,7 +851,6 @@ mod tests {
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
cx.foreground().start_waiting();
|
|
||||||
let (file_with_hints, editor, fake_server) = prepare_test_objects(cx).await;
|
let (file_with_hints, editor, fake_server) = prepare_test_objects(cx).await;
|
||||||
let lsp_request_count = Arc::new(AtomicU32::new(0));
|
let lsp_request_count = Arc::new(AtomicU32::new(0));
|
||||||
fake_server
|
fake_server
|
||||||
|
@ -890,7 +889,6 @@ mod tests {
|
||||||
})
|
})
|
||||||
.next()
|
.next()
|
||||||
.await;
|
.await;
|
||||||
cx.foreground().finish_waiting();
|
|
||||||
cx.foreground().run_until_parked();
|
cx.foreground().run_until_parked();
|
||||||
|
|
||||||
let mut edits_made = 1;
|
let mut edits_made = 1;
|
||||||
|
@ -976,7 +974,6 @@ mod tests {
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
cx.foreground().start_waiting();
|
|
||||||
let (file_with_hints, editor, fake_server) = prepare_test_objects(cx).await;
|
let (file_with_hints, editor, fake_server) = prepare_test_objects(cx).await;
|
||||||
let lsp_request_count = Arc::new(AtomicU32::new(0));
|
let lsp_request_count = Arc::new(AtomicU32::new(0));
|
||||||
let another_lsp_request_count = Arc::clone(&lsp_request_count);
|
let another_lsp_request_count = Arc::clone(&lsp_request_count);
|
||||||
|
@ -1025,7 +1022,6 @@ mod tests {
|
||||||
})
|
})
|
||||||
.next()
|
.next()
|
||||||
.await;
|
.await;
|
||||||
cx.foreground().finish_waiting();
|
|
||||||
cx.foreground().run_until_parked();
|
cx.foreground().run_until_parked();
|
||||||
|
|
||||||
let mut edits_made = 1;
|
let mut edits_made = 1;
|
||||||
|
@ -1311,7 +1307,6 @@ mod tests {
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
cx.foreground().start_waiting();
|
|
||||||
let (file_with_hints, editor, fake_server) = prepare_test_objects(cx).await;
|
let (file_with_hints, editor, fake_server) = prepare_test_objects(cx).await;
|
||||||
let fake_server = Arc::new(fake_server);
|
let fake_server = Arc::new(fake_server);
|
||||||
let lsp_request_count = Arc::new(AtomicU32::new(0));
|
let lsp_request_count = Arc::new(AtomicU32::new(0));
|
||||||
|
@ -1353,7 +1348,6 @@ mod tests {
|
||||||
expected_changes.push(change_after_opening);
|
expected_changes.push(change_after_opening);
|
||||||
}
|
}
|
||||||
|
|
||||||
cx.foreground().finish_waiting();
|
|
||||||
cx.foreground().run_until_parked();
|
cx.foreground().run_until_parked();
|
||||||
|
|
||||||
editor.update(cx, |editor, cx| {
|
editor.update(cx, |editor, cx| {
|
||||||
|
@ -1444,7 +1438,6 @@ mod tests {
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
cx.foreground().start_waiting();
|
|
||||||
let (file_with_hints, editor, fake_server) = prepare_test_objects(cx).await;
|
let (file_with_hints, editor, fake_server) = prepare_test_objects(cx).await;
|
||||||
let fake_server = Arc::new(fake_server);
|
let fake_server = Arc::new(fake_server);
|
||||||
let lsp_request_count = Arc::new(AtomicU32::new(0));
|
let lsp_request_count = Arc::new(AtomicU32::new(0));
|
||||||
|
@ -1488,7 +1481,6 @@ mod tests {
|
||||||
add_refresh_task(&mut initial_refresh_tasks);
|
add_refresh_task(&mut initial_refresh_tasks);
|
||||||
let _ = futures::future::join_all(initial_refresh_tasks).await;
|
let _ = futures::future::join_all(initial_refresh_tasks).await;
|
||||||
|
|
||||||
cx.foreground().finish_waiting();
|
|
||||||
cx.foreground().run_until_parked();
|
cx.foreground().run_until_parked();
|
||||||
|
|
||||||
editor.update(cx, |editor, cx| {
|
editor.update(cx, |editor, cx| {
|
||||||
|
@ -1546,8 +1538,8 @@ mod tests {
|
||||||
"Should apply all changes made"
|
"Should apply all changes made"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
assert_eq!(lsp_request_count.load(Ordering::Relaxed), 11);
|
assert_eq!(lsp_request_count.load(Ordering::Relaxed), 10);
|
||||||
let expected_hints = vec!["11".to_string()];
|
let expected_hints = vec!["10".to_string()];
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
expected_hints,
|
expected_hints,
|
||||||
cached_hint_labels(editor),
|
cached_hint_labels(editor),
|
||||||
|
@ -1587,8 +1579,8 @@ mod tests {
|
||||||
"Should apply all changes made"
|
"Should apply all changes made"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
assert_eq!(lsp_request_count.load(Ordering::Relaxed), 13);
|
assert_eq!(lsp_request_count.load(Ordering::Relaxed), 12);
|
||||||
let expected_hints = vec!["13".to_string()];
|
let expected_hints = vec!["12".to_string()];
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
expected_hints,
|
expected_hints,
|
||||||
cached_hint_labels(editor),
|
cached_hint_labels(editor),
|
||||||
|
@ -1641,14 +1633,22 @@ mod tests {
|
||||||
.await;
|
.await;
|
||||||
let project = Project::test(fs, ["/a".as_ref()], cx).await;
|
let project = Project::test(fs, ["/a".as_ref()], cx).await;
|
||||||
project.update(cx, |project, _| project.languages().add(Arc::new(language)));
|
project.update(cx, |project, _| project.languages().add(Arc::new(language)));
|
||||||
let (_, workspace) = cx.add_window(|cx| Workspace::test_new(project, cx));
|
let (_, workspace) = cx.add_window(|cx| Workspace::test_new(project.clone(), cx));
|
||||||
let worktree_id = workspace.update(cx, |workspace, cx| {
|
let worktree_id = workspace.update(cx, |workspace, cx| {
|
||||||
workspace.project().read_with(cx, |project, cx| {
|
workspace.project().read_with(cx, |project, cx| {
|
||||||
project.worktrees(cx).next().unwrap().read(cx).id()
|
project.worktrees(cx).next().unwrap().read(cx).id()
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let _buffer = project
|
||||||
|
.update(cx, |project, cx| {
|
||||||
|
project.open_local_buffer("/a/main.rs", cx)
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
cx.foreground().run_until_parked();
|
||||||
cx.foreground().start_waiting();
|
cx.foreground().start_waiting();
|
||||||
|
let fake_server = fake_servers.next().await.unwrap();
|
||||||
let editor = workspace
|
let editor = workspace
|
||||||
.update(cx, |workspace, cx| {
|
.update(cx, |workspace, cx| {
|
||||||
workspace.open_path((worktree_id, "main.rs"), None, true, cx)
|
workspace.open_path((worktree_id, "main.rs"), None, true, cx)
|
||||||
|
@ -1657,7 +1657,6 @@ mod tests {
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.downcast::<Editor>()
|
.downcast::<Editor>()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let fake_server = fake_servers.next().await.unwrap();
|
|
||||||
let lsp_request_ranges = Arc::new(Mutex::new(Vec::new()));
|
let lsp_request_ranges = Arc::new(Mutex::new(Vec::new()));
|
||||||
let lsp_request_count = Arc::new(AtomicU32::new(0));
|
let lsp_request_count = Arc::new(AtomicU32::new(0));
|
||||||
let closure_lsp_request_ranges = Arc::clone(&lsp_request_ranges);
|
let closure_lsp_request_ranges = Arc::clone(&lsp_request_ranges);
|
||||||
|
@ -1689,7 +1688,6 @@ mod tests {
|
||||||
})
|
})
|
||||||
.next()
|
.next()
|
||||||
.await;
|
.await;
|
||||||
cx.foreground().finish_waiting();
|
|
||||||
cx.foreground().run_until_parked();
|
cx.foreground().run_until_parked();
|
||||||
|
|
||||||
editor.update(cx, |editor, cx| {
|
editor.update(cx, |editor, cx| {
|
||||||
|
@ -1947,7 +1945,6 @@ mod tests {
|
||||||
.next()
|
.next()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
cx.foreground().finish_waiting();
|
|
||||||
cx.foreground().run_until_parked();
|
cx.foreground().run_until_parked();
|
||||||
|
|
||||||
editor.update(cx, |editor, cx| {
|
editor.update(cx, |editor, cx| {
|
||||||
|
@ -2135,13 +2132,22 @@ unedited (2nd) buffer should have the same hint");
|
||||||
|
|
||||||
let project = Project::test(fs, ["/a".as_ref()], cx).await;
|
let project = Project::test(fs, ["/a".as_ref()], cx).await;
|
||||||
project.update(cx, |project, _| project.languages().add(Arc::new(language)));
|
project.update(cx, |project, _| project.languages().add(Arc::new(language)));
|
||||||
let (_, workspace) = cx.add_window(|cx| Workspace::test_new(project, cx));
|
let (_, workspace) = cx.add_window(|cx| Workspace::test_new(project.clone(), cx));
|
||||||
let worktree_id = workspace.update(cx, |workspace, cx| {
|
let worktree_id = workspace.update(cx, |workspace, cx| {
|
||||||
workspace.project().read_with(cx, |project, cx| {
|
workspace.project().read_with(cx, |project, cx| {
|
||||||
project.worktrees(cx).next().unwrap().read(cx).id()
|
project.worktrees(cx).next().unwrap().read(cx).id()
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let _buffer = project
|
||||||
|
.update(cx, |project, cx| {
|
||||||
|
project.open_local_buffer("/a/main.rs", cx)
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
cx.foreground().run_until_parked();
|
||||||
|
cx.foreground().start_waiting();
|
||||||
|
let fake_server = fake_servers.next().await.unwrap();
|
||||||
let editor = workspace
|
let editor = workspace
|
||||||
.update(cx, |workspace, cx| {
|
.update(cx, |workspace, cx| {
|
||||||
workspace.open_path((worktree_id, "main.rs"), None, true, cx)
|
workspace.open_path((worktree_id, "main.rs"), None, true, cx)
|
||||||
|
@ -2151,8 +2157,6 @@ unedited (2nd) buffer should have the same hint");
|
||||||
.downcast::<Editor>()
|
.downcast::<Editor>()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let fake_server = fake_servers.next().await.unwrap();
|
|
||||||
|
|
||||||
("/a/main.rs", editor, fake_server)
|
("/a/main.rs", editor, fake_server)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2173,12 +2177,12 @@ unedited (2nd) buffer should have the same hint");
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visible_hint_labels(editor: &Editor, cx: &ViewContext<'_, '_, Editor>) -> Vec<String> {
|
fn visible_hint_labels(editor: &Editor, cx: &ViewContext<'_, '_, Editor>) -> Vec<String> {
|
||||||
let mut zz = editor
|
let mut hints = editor
|
||||||
.visible_inlay_hints(cx)
|
.visible_inlay_hints(cx)
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|hint| hint.text.to_string())
|
.map(|hint| hint.text.to_string())
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
zz.sort();
|
hints.sort();
|
||||||
zz
|
hints
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2631,7 +2631,7 @@ impl MultiBufferSnapshot {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
panic!("excerpt not found")
|
panic!("excerpt not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn can_resolve(&self, anchor: &Anchor) -> bool {
|
pub fn can_resolve(&self, anchor: &Anchor) -> bool {
|
||||||
|
|
|
@ -2827,23 +2827,23 @@ impl Project {
|
||||||
})
|
})
|
||||||
.detach();
|
.detach();
|
||||||
|
|
||||||
language_server
|
language_server
|
||||||
.on_request::<lsp::request::InlayHintRefreshRequest, _, _>({
|
.on_request::<lsp::request::InlayHintRefreshRequest, _, _>({
|
||||||
move |(), mut cx| async move {
|
move |(), mut cx| async move {
|
||||||
let this = this
|
let this = this
|
||||||
.upgrade(&cx)
|
.upgrade(&cx)
|
||||||
.ok_or_else(|| anyhow!("project dropped"))?;
|
.ok_or_else(|| anyhow!("project dropped"))?;
|
||||||
this.update(&mut cx, |project, cx| {
|
this.update(&mut cx, |project, cx| {
|
||||||
cx.emit(Event::RefreshInlays);
|
cx.emit(Event::RefreshInlays);
|
||||||
project.remote_id().map(|project_id| {
|
project.remote_id().map(|project_id| {
|
||||||
project.client.send(proto::RefreshInlayHints { project_id })
|
project.client.send(proto::RefreshInlayHints { project_id })
|
||||||
})
|
|
||||||
})
|
})
|
||||||
.transpose()?;
|
})
|
||||||
Ok(())
|
.transpose()?;
|
||||||
}
|
Ok(())
|
||||||
})
|
}
|
||||||
.detach();
|
})
|
||||||
|
.detach();
|
||||||
|
|
||||||
let disk_based_diagnostics_progress_token =
|
let disk_based_diagnostics_progress_token =
|
||||||
adapter.disk_based_diagnostics_progress_token.clone();
|
adapter.disk_based_diagnostics_progress_token.clone();
|
||||||
|
|
|
@ -137,9 +137,9 @@ message Envelope {
|
||||||
|
|
||||||
UpdateWorktreeSettings update_worktree_settings = 113;
|
UpdateWorktreeSettings update_worktree_settings = 113;
|
||||||
|
|
||||||
InlayHints inlay_hints = 114;
|
InlayHints inlay_hints = 116;
|
||||||
InlayHintsResponse inlay_hints_response = 115;
|
InlayHintsResponse inlay_hints_response = 117;
|
||||||
RefreshInlayHints refresh_inlay_hints = 116;
|
RefreshInlayHints refresh_inlay_hints = 118;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -198,7 +198,6 @@ function build_default_syntax(color_scheme: ColorScheme): Syntax {
|
||||||
hint: {
|
hint: {
|
||||||
color: color.hint,
|
color: color.hint,
|
||||||
weight: font_weights.bold,
|
weight: font_weights.bold,
|
||||||
// italic: true,
|
|
||||||
},
|
},
|
||||||
emphasis: {
|
emphasis: {
|
||||||
color: color.emphasis,
|
color: color.emphasis,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue