Move adapters to remote (#18359)

Release Notes:

- ssh remoting: run LSP Adapters on host

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
Conrad Irwin 2024-09-25 16:29:04 -06:00 committed by GitHub
parent 40408e731e
commit 64532e94e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 76 additions and 548 deletions

View file

@ -39,6 +39,7 @@ shellexpand.workspace = true
smol.workspace = true
worktree.workspace = true
language.workspace = true
languages.workspace = true
util.workspace = true
[dev-dependencies]

View file

@ -44,6 +44,10 @@ impl HeadlessProject {
pub fn new(session: Arc<SshSession>, fs: Arc<dyn Fs>, cx: &mut ModelContext<Self>) -> Self {
let languages = Arc::new(LanguageRegistry::new(cx.background_executor().clone()));
let node_runtime = NodeRuntime::unavailable();
languages::init(languages.clone(), node_runtime.clone(), cx);
let worktree_store = cx.new_model(|cx| {
let mut store = WorktreeStore::local(true, fs.clone());
store.shared(SSH_PROJECT_ID, session.clone().into(), cx);
@ -56,7 +60,7 @@ impl HeadlessProject {
});
let prettier_store = cx.new_model(|cx| {
PrettierStore::new(
NodeRuntime::unavailable(),
node_runtime,
fs.clone(),
languages.clone(),
worktree_store.clone(),
@ -116,12 +120,6 @@ impl HeadlessProject {
client.add_model_request_handler(BufferStore::handle_update_buffer);
client.add_model_message_handler(BufferStore::handle_close_buffer);
client.add_model_request_handler(LspStore::handle_create_language_server);
client.add_model_request_handler(LspStore::handle_which_command);
client.add_model_request_handler(LspStore::handle_shell_env);
client.add_model_request_handler(LspStore::handle_try_exec);
client.add_model_request_handler(LspStore::handle_read_text_file);
BufferStore::init(&client);
WorktreeStore::init(&client);
SettingsObserver::init(&client);