Add HOCON language support (#9203)
* Add HOCON language support * Remove error query Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * Change include query * Fix query error --------- Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
This commit is contained in:
parent
f8ae2bc61b
commit
a32d537d0a
4 changed files with 54 additions and 0 deletions
|
@ -68,6 +68,7 @@
|
||||||
| haskell-persistent | ✓ | | | |
|
| haskell-persistent | ✓ | | | |
|
||||||
| hcl | ✓ | | ✓ | `terraform-ls` |
|
| hcl | ✓ | | ✓ | `terraform-ls` |
|
||||||
| heex | ✓ | ✓ | | `elixir-ls` |
|
| heex | ✓ | ✓ | | `elixir-ls` |
|
||||||
|
| hocon | ✓ | | ✓ | |
|
||||||
| hosts | ✓ | | | |
|
| hosts | ✓ | | | |
|
||||||
| html | ✓ | | | `vscode-html-language-server` |
|
| html | ✓ | | | `vscode-html-language-server` |
|
||||||
| hurl | ✓ | | ✓ | |
|
| hurl | ✓ | | ✓ | |
|
||||||
|
|
|
@ -3013,3 +3013,15 @@ file-types = ["janet"]
|
||||||
comment-token = "#"
|
comment-token = "#"
|
||||||
indent = { tab-width = 2, unit = " " }
|
indent = { tab-width = 2, unit = " " }
|
||||||
grammar = "clojure"
|
grammar = "clojure"
|
||||||
|
|
||||||
|
[[language]]
|
||||||
|
name = "hocon"
|
||||||
|
scope = "source.conf"
|
||||||
|
file-types = ["conf"]
|
||||||
|
comment-token = "#"
|
||||||
|
auto-format = true
|
||||||
|
indent = { tab-width = 2, unit = " " }
|
||||||
|
|
||||||
|
[[grammar]]
|
||||||
|
name = "hocon"
|
||||||
|
source = { git = "https://github.com/antosha417/tree-sitter-hocon", rev = "c390f10519ae69fdb03b3e5764f5592fb6924bcc" }
|
||||||
|
|
31
runtime/queries/hocon/highlights.scm
Normal file
31
runtime/queries/hocon/highlights.scm
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
(comment) @comment
|
||||||
|
|
||||||
|
(null) @constant.builtin
|
||||||
|
[(true) (false)] @constant.builtin.boolean
|
||||||
|
(number) @constant.numeric
|
||||||
|
(string) @string
|
||||||
|
(multiline_string) @string
|
||||||
|
(string (escape_sequence) @constant.character.escape)
|
||||||
|
(unquoted_string) @string
|
||||||
|
|
||||||
|
(value [":" "=" "+=" ] @operator)
|
||||||
|
|
||||||
|
(substitution (_) @string)
|
||||||
|
(substitution ["${" "${?" "}"] @punctuation.special)
|
||||||
|
|
||||||
|
[
|
||||||
|
"url"
|
||||||
|
"file"
|
||||||
|
"classpath"
|
||||||
|
"required"
|
||||||
|
] @function.builtin
|
||||||
|
|
||||||
|
(include) @keyword.directive
|
||||||
|
|
||||||
|
[ "(" ")" "[" "]" "{" "}" ] @punctuation.bracket
|
||||||
|
|
||||||
|
(unit) @keyword
|
||||||
|
(path (_) @keyword)
|
||||||
|
(unquoted_path "." @punctuation.delimiter)
|
||||||
|
[ "," ] @punctuation.delimiter
|
||||||
|
|
10
runtime/queries/hocon/indents.scm
Normal file
10
runtime/queries/hocon/indents.scm
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
[
|
||||||
|
(object)
|
||||||
|
(array)
|
||||||
|
] @indent
|
||||||
|
|
||||||
|
[
|
||||||
|
"]"
|
||||||
|
"}"
|
||||||
|
] @outdent
|
||||||
|
|
Loading…
Reference in a new issue