Give the editor a handle to the project, not a weak handle to the workspace
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
624dbc1d0e
commit
6731d92f60
10 changed files with 112 additions and 112 deletions
|
@ -8,7 +8,7 @@ mod tests;
|
|||
|
||||
use anyhow::{anyhow, Result};
|
||||
use collections::HashSet;
|
||||
use gpui::AppContext;
|
||||
use gpui::{AppContext, TestAppContext};
|
||||
use highlight_map::HighlightMap;
|
||||
use lazy_static::lazy_static;
|
||||
use parking_lot::Mutex;
|
||||
|
@ -357,18 +357,15 @@ impl CompletionLabel {
|
|||
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
impl LanguageServerConfig {
|
||||
pub async fn fake(
|
||||
executor: Arc<gpui::executor::Background>,
|
||||
) -> (Self, lsp::FakeLanguageServer) {
|
||||
Self::fake_with_capabilities(Default::default(), executor).await
|
||||
pub async fn fake(cx: &TestAppContext) -> (Self, lsp::FakeLanguageServer) {
|
||||
Self::fake_with_capabilities(Default::default(), cx).await
|
||||
}
|
||||
|
||||
pub async fn fake_with_capabilities(
|
||||
capabilites: lsp::ServerCapabilities,
|
||||
executor: Arc<gpui::executor::Background>,
|
||||
cx: &TestAppContext,
|
||||
) -> (Self, lsp::FakeLanguageServer) {
|
||||
let (server, fake) =
|
||||
lsp::LanguageServer::fake_with_capabilities(capabilites, executor).await;
|
||||
let (server, fake) = lsp::LanguageServer::fake_with_capabilities(capabilites, cx).await;
|
||||
fake.started
|
||||
.store(false, std::sync::atomic::Ordering::SeqCst);
|
||||
let started = fake.started.clone();
|
||||
|
|
|
@ -557,7 +557,7 @@ fn test_autoindent_adjusts_lines_when_only_text_changes(cx: &mut MutableAppConte
|
|||
|
||||
#[gpui::test]
|
||||
async fn test_diagnostics(mut cx: gpui::TestAppContext) {
|
||||
let (language_server, mut fake) = lsp::LanguageServer::fake(cx.background()).await;
|
||||
let (language_server, mut fake) = lsp::LanguageServer::fake(&cx).await;
|
||||
let mut rust_lang = rust_lang();
|
||||
rust_lang.config.language_server = Some(LanguageServerConfig {
|
||||
disk_based_diagnostic_sources: HashSet::from_iter(["disk".to_string()]),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue