Skip to content

Commit 6b73c3c

Browse files
authored
feat: add shellcheckrc language (#14202)
1 parent b309d72 commit 6b73c3c

File tree

5 files changed

+82
-0
lines changed

5 files changed

+82
-0
lines changed

book/src/generated/lang-support.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@
227227
| scala |||| | | `metals` |
228228
| scheme || || || |
229229
| scss || | | || `vscode-css-language-server` |
230+
| shellcheckrc ||| | | | |
230231
| slang |||| | | `slangd` |
231232
| slint |||| | | `slint-lsp` |
232233
| smali || || | | |

languages.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4722,3 +4722,14 @@ indent = { tab-width = 4, unit = " " }
47224722
[[grammar]]
47234723
name = "cython"
47244724
source = { git = "https://github.com/b0o/tree-sitter-cython", rev = "62f44f5e7e41dde03c5f0a05f035e293bcf2bcf8" }
4725+
4726+
[[language]]
4727+
name = "shellcheckrc"
4728+
scope = "source.shellcheckrc"
4729+
injection-regex = "shellcheck(rc)?"
4730+
file-types = [{glob = "shellcheckrc"}, {glob = ".shellcheckrc"}]
4731+
comment-token = "#"
4732+
4733+
[[grammar]]
4734+
name = "shellcheckrc"
4735+
source = {git = "https://codeberg.org/kpbaks/tree-sitter-shellcheckrc", rev = "ad3da4e8f7fd72dcc5e93a6b89822c59a7cd10ff"}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
(comment) @comment
2+
(string) @string
3+
(boolean) @constant.builtin.boolean
4+
(integer) @constant.numeric.integer
5+
6+
[
7+
"disable"
8+
"enable"
9+
"extended-analysis"
10+
"external-sources"
11+
"source"
12+
"source-path"
13+
"shell"
14+
] @keyword
15+
16+
"=" @operator
17+
18+
[
19+
","
20+
"-"
21+
] @punctuation.delimiter
22+
23+
"SC" @special
24+
25+
(shell) @type.enum.variant
26+
27+
(all) @variable.builtin
28+
29+
(identifier) @label
30+
31+
(source_directive
32+
(identifier) @string.special.path)
33+
34+
(source_path_directive
35+
(identifier) @string.special.path)
36+
37+
(source_directive
38+
(identifier) @variable.builtin (#eq? @variable.builtin "SCRIPTDIR"))
39+
40+
(source_path_directive
41+
(identifier) @variable.builtin (#eq? @variable.builtin "SCRIPTDIR"))
42+
43+
(enable_directive
44+
(identifier) @diagnostic.error
45+
(#not-any-of? @diagnostic.error
46+
"add-default-case"
47+
"avoid-nullary-conditions"
48+
"check-extra-masked-returns"
49+
"check-set-e-suppressed"
50+
"check-unassigned-uppercase"
51+
"deprecate-which"
52+
"quote-safe-variables"
53+
"require-double-brackets"
54+
"require-variable-braces"
55+
))
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
((comment) @injection.content
2+
(#set! injection.language "comment"))
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
(comment) @comment.inside
2+
(comment)+ @comment.around
3+
4+
5+
[
6+
(disable_directive)
7+
(enable_directive)
8+
(extended_analysis_directive)
9+
(external_sources_directive)
10+
(source_directive)
11+
(source_path_directive)
12+
(shell_directive)
13+
] @entry.around

0 commit comments

Comments
 (0)