Skip to content

Commit 55fb592

Browse files
authored
Adjust HEEx config (#77)
- Adds other suffixes that should be recognised as HEEx files - Adjusts block comment configuration - Adds auto-completion for a few other bracket delimiters - Enforces a tab size of 2 by default (the formatter enforces this too) - Adds override for comments
1 parent 35c7389 commit 55fb592

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

languages/heex/config.toml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
name = "HEEX"
22
grammar = "heex"
3-
path_suffixes = ["heex"]
4-
autoclose_before = ">})"
3+
path_suffixes = ["heex", "html.eex", "leex", "neex"]
4+
block_comment = { start = "<%!--", prefix = "", end = "--%>", tab_size = 0 }
5+
wrap_characters = { start_prefix = "<", start_suffix = ">", end_prefix = "</", end_suffix = ">" }
6+
autoclose_before = ">})%"
57
brackets = [
68
{ start = "{", end = "}", close = true, newline = true },
79
{ start = "[", end = "]", close = true, newline = true },
810
{ start = "(", end = ")", close = true, newline = true },
911
{ start = "<", end = ">", close = true, newline = true },
12+
{ start = "%", end = "%", close = true, newline = true },
13+
{ start = "\"", end = "\"", close = true, newline = false, not_in = ["string", "comment"] },
14+
{ start = "'", end = "'", close = true, newline = false, not_in = ["string", "comment"] },
15+
{ start = "!--", end = " --", close = true, newline = false, not_in = ["string", "comment"] },
1016
]
11-
block_comment = ["<%!-- ", " --%>"]
17+
tab_size = 2
1218
scope_opt_in_language_servers = ["tailwindcss-language-server"]
1319

1420
[overrides.string]

languages/heex/overrides.scm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
(comment) @comment.inclusive
2+
13
[
24
(attribute_value)
35
(quoted_attribute_value)

0 commit comments

Comments
 (0)