mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-07 09:17:27 +00:00
Magic incantations for Tailwind autocomplete in more languages (#3141)
Release Notes: - Added Tailwind autocomplete to Svelte files ([#2029](https://github.com/zed-industries/community/issues/2029)). - Added Tailwind autocomplete to Phoenix HEEX files ([#2057](https://github.com/zed-industries/community/issues/2057)). - Added Tailwind autocomplete to Phoenix ~H sigil in Elixir files ([#2057](https://github.com/zed-industries/community/issues/2057)). - Added Tailwind autocomplete to ERB files ([#2153](https://github.com/zed-industries/community/issues/2153)). - Added Tailwind autocomplete to PHP files ([#2159](https://github.com/zed-industries/community/issues/2159)). - Added Tailwind autocomplete to Laravel Blade files ([#2159](https://github.com/zed-industries/community/issues/2159)).
This commit is contained in:
commit
808976ee28
7 changed files with 40 additions and 8 deletions
|
@ -76,7 +76,10 @@ pub fn init(
|
|||
elixir::ElixirLspSetting::ElixirLs => language(
|
||||
"elixir",
|
||||
tree_sitter_elixir::language(),
|
||||
vec![Arc::new(elixir::ElixirLspAdapter)],
|
||||
vec![
|
||||
Arc::new(elixir::ElixirLspAdapter),
|
||||
Arc::new(tailwind::TailwindLspAdapter::new(node_runtime.clone())),
|
||||
],
|
||||
),
|
||||
elixir::ElixirLspSetting::NextLs => language(
|
||||
"elixir",
|
||||
|
@ -101,7 +104,10 @@ pub fn init(
|
|||
language(
|
||||
"heex",
|
||||
tree_sitter_heex::language(),
|
||||
vec![Arc::new(elixir::ElixirLspAdapter)],
|
||||
vec![
|
||||
Arc::new(elixir::ElixirLspAdapter),
|
||||
Arc::new(tailwind::TailwindLspAdapter::new(node_runtime.clone())),
|
||||
],
|
||||
);
|
||||
language(
|
||||
"json",
|
||||
|
@ -184,9 +190,10 @@ pub fn init(
|
|||
language(
|
||||
"svelte",
|
||||
tree_sitter_svelte::language(),
|
||||
vec![Arc::new(svelte::SvelteLspAdapter::new(
|
||||
node_runtime.clone(),
|
||||
))],
|
||||
vec![
|
||||
Arc::new(svelte::SvelteLspAdapter::new(node_runtime.clone())),
|
||||
Arc::new(tailwind::TailwindLspAdapter::new(node_runtime.clone())),
|
||||
],
|
||||
);
|
||||
language(
|
||||
"php",
|
||||
|
|
|
@ -9,3 +9,8 @@ brackets = [
|
|||
{ start = "\"", end = "\"", close = true, newline = false, not_in = ["string", "comment"] },
|
||||
{ start = "'", end = "'", close = true, newline = false, not_in = ["string", "comment"] },
|
||||
]
|
||||
scope_opt_in_language_servers = ["tailwindcss-language-server"]
|
||||
|
||||
[overrides.string]
|
||||
word_characters = ["-"]
|
||||
opt_into_language_servers = ["tailwindcss-language-server"]
|
||||
|
|
|
@ -5,3 +5,8 @@ brackets = [
|
|||
{ start = "<", end = ">", close = true, newline = true },
|
||||
]
|
||||
block_comment = ["<%!-- ", " --%>"]
|
||||
scope_opt_in_language_servers = ["tailwindcss-language-server"]
|
||||
|
||||
[overrides.string]
|
||||
word_characters = ["-"]
|
||||
opt_into_language_servers = ["tailwindcss-language-server"]
|
||||
|
|
4
crates/zed/src/languages/heex/overrides.scm
Normal file
4
crates/zed/src/languages/heex/overrides.scm
Normal file
|
@ -0,0 +1,4 @@
|
|||
[
|
||||
(attribute_value)
|
||||
(quoted_attribute_value)
|
||||
] @string
|
|
@ -12,7 +12,8 @@ brackets = [
|
|||
{ start = "`", end = "`", close = true, newline = false, not_in = ["string"] },
|
||||
{ start = "/*", end = " */", close = true, newline = false, not_in = ["string", "comment"] },
|
||||
]
|
||||
scope_opt_in_language_servers = ["tailwindcss-language-server"]
|
||||
|
||||
[overrides.element]
|
||||
line_comment = { remove = true }
|
||||
block_comment = ["{/* ", " */}"]
|
||||
[overrides.string]
|
||||
word_characters = ["-"]
|
||||
opt_into_language_servers = ["tailwindcss-language-server"]
|
||||
|
|
7
crates/zed/src/languages/svelte/overrides.scm
Normal file
7
crates/zed/src/languages/svelte/overrides.scm
Normal file
|
@ -0,0 +1,7 @@
|
|||
(comment) @comment
|
||||
|
||||
[
|
||||
(raw_text)
|
||||
(attribute_value)
|
||||
(quoted_attribute_value)
|
||||
] @string
|
|
@ -123,6 +123,9 @@ impl LspAdapter for TailwindLspAdapter {
|
|||
("CSS".to_string(), "css".to_string()),
|
||||
("JavaScript".to_string(), "javascript".to_string()),
|
||||
("TSX".to_string(), "typescriptreact".to_string()),
|
||||
("Svelte".to_string(), "svelte".to_string()),
|
||||
("Elixir".to_string(), "phoenix-heex".to_string()),
|
||||
("HEEX".to_string(), "phoenix-heex".to_string()),
|
||||
]
|
||||
.into_iter(),
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue