Extract Terraform extension (#10479)

This PR extracts Terraform support into an extension and removes the
built-in Terraform support from Zed.

Release Notes:

- Removed built-in support for Terraform, in favor of making it
available as
an extension. The Terraform extension will be suggested for download
when you
open a `.tf`, `.tfvars`, or `.hcl` file.
This commit is contained in:
Marshall Bowers 2024-04-12 11:49:49 -04:00 committed by GitHub
parent f4d9a97195
commit b5b872656b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 162 additions and 208 deletions

View file

@ -10,7 +10,7 @@ use gpui::AsyncAppContext;
use language::{
CodeLabel, HighlightId, Language, LanguageServerName, LspAdapter, LspAdapterDelegate,
};
use lsp::LanguageServerBinary;
use lsp::{CodeActionKind, LanguageServerBinary};
use serde::Serialize;
use serde_json::Value;
use std::ops::Range;
@ -129,6 +129,24 @@ impl LspAdapter for ExtensionLspAdapter {
None
}
fn code_action_kinds(&self) -> Option<Vec<CodeActionKind>> {
if self.extension.manifest.id.as_ref() == "terraform" {
// This is taken from the original Terraform implementation, including
// the TODOs:
// TODO: file issue for server supported code actions
// TODO: reenable default actions / delete override
return Some(vec![]);
}
Some(vec![
CodeActionKind::EMPTY,
CodeActionKind::QUICKFIX,
CodeActionKind::REFACTOR,
CodeActionKind::REFACTOR_EXTRACT,
CodeActionKind::SOURCE,
])
}
fn language_ids(&self) -> HashMap<String, String> {
// TODO: The language IDs can be provided via the language server options
// in `extension.toml now but we're leaving these existing usages in place temporarily