Skip to content

Commit b8f9ad0

Browse files
Add syntax highlighting rules for .properties files
1 parent dc2d70b commit b8f9ad0

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

runtime/syntax/properties.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
filetype: properties
2+
3+
detect:
4+
filename: "\\.properties$"
5+
6+
rules:
7+
# Key (Identifier) - Matches everything before the first = or :
8+
- identifier: "^[[:space:]]*[^=:[:space:]]+"
9+
10+
# Assignment operators
11+
- statement: "[=:]"
12+
13+
# Boolean constants
14+
- constant: "\\b(true|false|TRUE|FALSE|yes|no|ON|OFF)\\b"
15+
16+
# Strings/Values (Simple match for text after assignment)
17+
- constant.string: "([=:][[:space:]]*).*$"
18+
19+
# Comments - Properties files support both # and !
20+
- comment:
21+
start: "[#!]"
22+
end: "$"
23+
rules:
24+
- todo: "(TODO|XXX|FIXME):?"
25+
26+
# Special characters like escaped spaces or newlines
27+
- constant.specialChar: "\\\\([ tnfr'\"\\\\]|u[0-9a-fA-F]{4})"

0 commit comments

Comments
 (0)