on master help sign in
Add SCSS language support (#3074)
commit0c9594e41ea18f71a0b1de386396575e6f73fc12 authorJoe <Josephharrisonlim@gmail.com> dateSun 17 Jul 2022, 05:55 (4 years ago) parentbcacc70
4 files changed+102
book/src/generated/lang-support.md+1 languages.toml+13 runtime/queries/scss/highlights.scm+86 runtime/queries/scss/injections.scm+2
book/src/generated/lang-support.md+1
@@ -85,6 +85,7 @@
8585| rust | ✓ | ✓ | ✓ | `rust-analyzer` |
8686| scala | ✓ | | ✓ | `metals` |
8787| scheme | ✓ | | | |
88+| scss | ✓ | | | `vscode-css-language-server` |
8889| solidity | ✓ | | | `solc` |
8990| sql | ✓ | | | |
9091| sshclientconfig | ✓ | | | |
languages.toml+13
@@ -381,6 +381,19 @@ indent = { tab-width = 2, unit = " " }
381381name = "css"
382382source = { git = "https://github.com/tree-sitter/tree-sitter-css", rev = "94e10230939e702b4fa3fa2cb5c3bc7173b95d07" }
383383
384+[[language]]
385+name = "scss"
386+scope = "source.scss"
387+injection-regex = "scss"
388+file-types = ["scss"]
389+roots = []
390+language-server = { command = "vscode-css-language-server", args = ["--stdio"] }
391+indent = { tab-width = 2, unit = " " }
392+
393+[[grammar]]
394+name = "scss"
395+source = { git = "https://github.com/serenadeai/tree-sitter-scss.git", rev = "c478c6868648eff49eb04a4df90d703dc45b312a" }
396+
384397[[language]]
385398name = "html"
386399scope = "text.html.basic"
runtime/queries/scss/highlights.scmnew file+86
@@ -0,0 +1,86 @@
1+(comment) @comment
2+
3+"~" @operator
4+">" @operator
5+"+" @operator
6+"-" @operator
7+"*" @operator
8+"/" @operator
9+"=" @operator
10+"^=" @operator
11+"|=" @operator
12+"~=" @operator
13+"$=" @operator
14+"*=" @operator
15+
16+"in" @operator
17+"and" @operator
18+"or" @operator
19+"not" @operator
20+"only" @operator
21+
22+"@apply" @constant.builtin
23+"@at-root" @constant.builtin
24+"@charset" @constant.builtin
25+"@debug" @constant.builtin
26+"@each" @keyword.control.repeat
27+"@else" @keyword.control.conditional
28+"@error" @constant.builtin
29+"@extend" @constant.builtin
30+"@for" @keyword.control.repeat
31+"@forward" @keyword.control.import
32+"@function" @function.method
33+"@if" @keyword.control.conditional
34+"@import" @keyword.control.import
35+"@include" @keyword.control.import
36+"@keyframes" @constant.builtin
37+"@media" @constant.builtin
38+"@mixin" @constant.builtin
39+"@namespace" @namespace
40+"@return" @keyword.control.return
41+"@supports" @constant.builtin
42+"@use" @keyword.control.import
43+"@warn" @constant.builtin
44+"@while" @keyword.control.repeat
45+
46+((property_name) @variable
47+ (match? @variable "^--"))
48+((plain_value) @variable
49+ (match? @variable "^--"))
50+
51+(tag_name) @tag
52+(universal_selector) @tag
53+(attribute_selector (plain_value) @string)
54+(nesting_selector) @variable.other.member
55+(pseudo_element_selector) @attribute
56+(pseudo_class_selector) @attribute
57+
58+(identifier) @variable
59+(class_name) @variable
60+(id_name) @variable
61+(namespace_name) @variable
62+(property_name) @variable.other.member
63+(feature_name) @variable
64+(variable) @variable
65+(variable_name) @variable.other.member
66+(variable_value) @variable.other.member
67+(argument_name) @variable.parameter
68+(selectors) @variable.other.member
69+
70+(attribute_name) @attribute
71+
72+(function_name) @function
73+
74+(to) @keyword
75+(from) @keyword
76+(important) @keyword
77+
78+(string_value) @string
79+(color_value) @string.special
80+
81+(integer_value) @constant.numeric.integer
82+(float_value) @constant.numeric.float
83+(unit) @type
84+
85+"#" @punctuation.delimiter
86+"," @punctuation.delimiter
runtime/queries/scss/injections.scmnew file+2
@@ -0,0 +1,2 @@
1+((comment) @injection.content
2+ (#set! injection.language "comment"))