Refactor LanguageSever::fake into FakeLanguageServer::new

This is just moving code around and doesn't change behaviour, but it's
something Julia and I bumped into yesterday while writing docs.
This commit is contained in:
Thorsten Ball 2024-01-18 10:59:32 +01:00
parent 29c81e08bb
commit 5e6d1a47b2
3 changed files with 24 additions and 20 deletions

View file

@ -369,10 +369,11 @@ impl Copilot {
#[cfg(any(test, feature = "test-support"))]
pub fn fake(cx: &mut gpui::TestAppContext) -> (Model<Self>, lsp::FakeLanguageServer) {
use lsp::FakeLanguageServer;
use node_runtime::FakeNodeRuntime;
let (server, fake_server) =
LanguageServer::fake("copilot".into(), Default::default(), cx.to_async());
FakeLanguageServer::new("copilot".into(), Default::default(), cx.to_async());
let http = util::http::FakeHttpClient::create(|_| async { unreachable!() });
let node_runtime = FakeNodeRuntime::new();
let this = cx.new_model(|cx| Self {