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:
Max Brunsfeld 2022-02-08 15:48:44 -08:00
parent 624dbc1d0e
commit 6731d92f60
10 changed files with 112 additions and 112 deletions

View file

@ -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();