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:
Jaakko Paju 2024-01-08 04:04:43 +02:00 committed by GitHub
parent f8ae2bc61b
commit a32d537d0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 54 additions and 0 deletions

View File

@ -68,6 +68,7 @@
| haskell-persistent | ✓ | | | |
| hcl | ✓ | | ✓ | `terraform-ls` |
| heex | ✓ | ✓ | | `elixir-ls` |
| hocon | ✓ | | ✓ | |
| hosts | ✓ | | | |
| html | ✓ | | | `vscode-html-language-server` |
| hurl | ✓ | | ✓ | |

View File

@ -3013,3 +3013,15 @@ file-types = ["janet"]
comment-token = "#"
indent = { tab-width = 2, unit = " " }
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" }

View 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

View File

@ -0,0 +1,10 @@
[
(object)
(array)
] @indent
[
"]"
"}"
] @outdent