on master help sign in
Add slint-ui support
f09d2bcErasin
book/src/generated/lang-support.md+1
@@ -90,6 +90,7 @@
90| scala | ✓ | | ✓ | `metals` |
90| scala | ✓ | | ✓ | `metals` |
91| scheme | ✓ | | | |
91| scheme | ✓ | | | |
92| scss | ✓ | | | `vscode-css-language-server` |
92| scss | ✓ | | | `vscode-css-language-server` |
93+| slint | ✓ | | ✓ | `slint-lsp` |
93| solidity | ✓ | | | `solc` |
94| solidity | ✓ | | | `solc` |
94| sql | ✓ | | | |
95| sql | ✓ | | | |
95| sshclientconfig | ✓ | | | |
96| sshclientconfig | ✓ | | | |
languages.toml+14
@@ -1613,3 +1613,17 @@ indent = { tab-width = 4, unit = "\t" }
1613[[grammar]]
1613[[grammar]]
1614name = "cue"
1614name = "cue"
1615source = { git = "https://github.com/eonpatapon/tree-sitter-cue", rev = "61843e3beebf19417e4fede4e8be4df1084317ad" }
1615source = { git = "https://github.com/eonpatapon/tree-sitter-cue", rev = "61843e3beebf19417e4fede4e8be4df1084317ad" }
1616+
1617+[[language]]
1618+name = "slint"
1619+scope = "source.slint"
1620+injection-regex = "slint"
1621+file-types = ["slint"]
1622+roots = []
1623+comment-token = "//"
1624+indent = { tab-width = 4, unit = " " }
1625+language-server = { command = "slint-lsp", args = [] }
1626+
1627+[[grammar]]
1628+name = "slint"
1629+source = { git = "https://github.com/jrmoulton/tree-sitter-slint", rev = "0d4dda94f96623302dfc234e06be62a5717f47da" }
runtime/queries/slint/highlights.scmnew file+125
@@ -0,0 +1,125 @@
1+
2+(user_type_identifier) @type
3+
4+(var_identifier) @variable
5+
6+(state_identifier) @variable.other.member
7+
8+(var_identifier
9+ (post_identifier) @variable)
10+
11+(function_identifier) @function
12+
13+(reference_identifier) @keyword.storage.modifier.ref
14+(visibility_modifier) @keyword.storage.modifier
15+
16+(comment) @comment
17+
18+(string) @string
19+(int_number) @constant.numeric
20+(unit_type) @type.builtin
21+
22+[
23+"struct"
24+"property"
25+"callback"
26+"import"
27+"from"
28+"root"
29+"parent"
30+"this"
31+"for"
32+"in"
33+"if"
34+"else if"
35+"else"
36+"animate"
37+"states"
38+"when"
39+"in"
40+"out"
41+"transitions"
42+"global"
43+] @keyword
44+
45+[
46+ "black"
47+ "transparent"
48+ "blue"
49+ "ease"
50+ "ease_in"
51+ "ease-in"
52+ "ease_in_out"
53+ "ease-in-out"
54+ "ease_out"
55+ "ease-out"
56+ "end"
57+ "green"
58+ "red"
59+ "red"
60+ "start"
61+ "yellow"
62+ "true"
63+ "false"
64+ ] @constant.builtin
65+
66+"@" @keyword
67+
68+; ; Punctuation
69+[
70+ ","
71+ "."
72+] @punctuation.delimiter
73+
74+; ; Brackets
75+[
76+"("
77+")"
78+"["
79+"]"
80+"{"
81+"}"
82+] @punctuation.bracket
83+
84+[
85+"angle"
86+"bool"
87+"brush"
88+; "color" // This causes problems
89+"duration"
90+"easing"
91+"float"
92+"image"
93+"int"
94+"length"
95+"percent"
96+"physical-length"
97+"physical_length"
98+"string"
99+] @type.builtin
100+
101+[
102+ ":="
103+ "!"
104+ "-"
105+ "+"
106+ "*"
107+ "/"
108+ "&&"
109+ "||"
110+ ">"
111+ "<"
112+ ">="
113+ "<="
114+ "="
115+ ":"
116+ "+="
117+ "-="
118+ "*="
119+ "/="
120+ "?"
121+
122+ "=>"
123+ ] @operator
124+
125+(ternary_expression [":" "?"] @keyword.control.conditional)
runtime/queries/slint/indents.scmnew file+29
@@ -0,0 +1,29 @@
1+
2+; [
3+; (struct_definition)
4+; (component_definition)
5+; ] @indent
6+
7+[
8+(field_declaration_list_body)
9+(list_definition_body)
10+(struct_field_declaration_list_body)
11+] @indent
12+
13+; [
14+; "{"
15+; "}"
16+; "("
17+; ")"
18+; (if_statement)
19+; "else if"
20+; "else"
21+; ] @branch
22+
23+; "{" @indent
24+"}" @indent_end
25+
26+(comment) @auto
27+
28+(string) @auto
29+
runtime/queries/slint/locals.scmnew file+3
@@ -0,0 +1,3 @@
1+; locals.scm
2+
3+(component_definition) @local.scope