languages: add Java .properties file support (#13874)

pull/13894/head
Kristoffer Plagborg Bak Sørensen 2025-07-04 16:17:22 +02:00 committed by GitHub
parent 6c6607ef62
commit 9789b27461
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 63 additions and 0 deletions

View File

@ -184,6 +184,7 @@
| powershell | ✓ | | | | | powershell | ✓ | | | |
| prisma | ✓ | ✓ | | `prisma-language-server` | | prisma | ✓ | ✓ | | `prisma-language-server` |
| prolog | ✓ | | ✓ | `swipl` | | prolog | ✓ | | ✓ | `swipl` |
| properties | ✓ | ✓ | | |
| protobuf | ✓ | ✓ | ✓ | `buf`, `pb`, `protols` | | protobuf | ✓ | ✓ | ✓ | `buf`, `pb`, `protols` |
| prql | ✓ | | | | | prql | ✓ | | | |
| pug | ✓ | | | | | pug | ✓ | | | |

View File

@ -4450,3 +4450,14 @@ auto-format = true
[[grammar]] [[grammar]]
name = "caddyfile" name = "caddyfile"
source = { git = "https://github.com/caddyserver/tree-sitter-caddyfile", rev = "b04bdb4ec53e40c44afbf001e15540f60a296aef" } source = { git = "https://github.com/caddyserver/tree-sitter-caddyfile", rev = "b04bdb4ec53e40c44afbf001e15540f60a296aef" }
[[language]]
name = "properties"
scope = "source.properties"
injection-regex = "properties"
file-types = ["properties", "prefs"]
comment-tokens = ["#"]
[[grammar]]
name = "properties"
source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-properties", rev = "579b62f5ad8d96c2bb331f07d1408c92767531d9" }

View File

@ -0,0 +1,40 @@
(comment) @comment
(key) @attribute
(value) @string
(value (escape) @constant.character.escape)
((index) @constant.numeric.integer
(#match? @constant.numeric.integer "^[0-9]+$"))
((substitution (key) @constant)
(#match? @constant "^[A-Z0-9_]+"))
((value) @constant.builtin.boolean
(#any-of? @constant.builtin.boolean "true" "false" "enabled" "disabled"))
((value) @constant.numeric.integer
(#match? @constant.numeric.integer "^-?[0-9]+$"))
((value) @constant.numeric.float
(#match? @constant.numeric.float "^-?[0-9]+\.[0-9]$"))
((value) @string.special.path
(#match? @string.special.path "^(\.{1,2})?/"))
(substitution
(key) @function
"::" @punctuation.special
(secret) @string.special.symbol)
(property [ "=" ":" ] @keyword.operator)
[ "${" "}" ] @punctuation.special
(substitution ":" @punctuation.special)
[ "[" "]" ] @punctuation.bracket
[ "." "\\" ] @punctuation.delimiter

View File

@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))

View File

@ -0,0 +1,5 @@
(property
(key) @local.definition.attribute)
(substitution
(key) @local.reference)

View File

@ -0,0 +1,4 @@
(comment) @comment.inside
(comment)+ @comment.around
(property (key) @parameter.inside) @parameter.around