Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree-sitter rolling fixes (January edition) #859

Merged
Merged
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
93ab0f7
Convert all modern Tree-sitter TODO/hyperlink injections into services
savetheclocktower Jan 14, 2024
fbc2c82
Prevent certain Python strings from being double-scoped
savetheclocktower Jan 14, 2024
6069a59
Remove the requirement for a grammar to have a `highlightsQuery`
savetheclocktower Jan 14, 2024
09184d9
Add documentation for the new TODO/hyperlink services
savetheclocktower Jan 14, 2024
dfb2493
Add some more stray `.eslintrc` files
savetheclocktower Jan 14, 2024
95de9bc
[language-typescript] Distinguish different usages of `<` and `>`
savetheclocktower Jan 14, 2024
e972f92
Score a Tree-sitter grammar as `-1` if they’re disabled in config
savetheclocktower Jan 16, 2024
bbf5242
[language-typescript] Highlighting fixes for TS and TSX:
savetheclocktower Jan 16, 2024
99388fa
[language-typescript] Correctly highlight the angle brackets of TSX tags
savetheclocktower Jan 17, 2024
79d1cff
[language-javascript] Upgrade `tree-sitter-javascript` parser to latest…
savetheclocktower Jan 17, 2024
1ddcff4
[language-javascript] Rename grammar files for consistency
savetheclocktower Jan 17, 2024
55a8762
[language-css] Update `tree-sitter-css` parser to latest
savetheclocktower Jan 17, 2024
3d526d7
Add a setting to control `switch`/`case` indentation for JS/TS
savetheclocktower Jan 17, 2024
a53a9f6
[language-javascript] Fix `indents.scm` after the parser upgrade
savetheclocktower Jan 17, 2024
cac042b
[language-php] Support some things that were accidentally omitted…
savetheclocktower Jan 17, 2024
52e2efd
Fix CI validation trying to check for a file that has been deleted
savetheclocktower Jan 17, 2024
13c5c07
Change references to JS grammar path in specs
savetheclocktower Jan 18, 2024
4a8df88
Fix other grammar paths
savetheclocktower Jan 18, 2024
1ed84b8
Adjust fold in response to `tree-sitter-javascript` change
savetheclocktower Jan 18, 2024
3864c0d
[language-go] Update `tree-sitter-go` parser to latest…
savetheclocktower Jan 18, 2024
f171f33
[language-go] Highlight method names like function names
savetheclocktower Jan 19, 2024
937cb15
[language-c] Apply some fixes to C/C++ highlighting
savetheclocktower Jan 19, 2024
57e812b
[language-typescript] Harmonize syntax decisions between JS and TS…
savetheclocktower Jan 19, 2024
3cd7557
[language-shellscript] Highlight `while` and add other fixes…
savetheclocktower Jan 19, 2024
a13ffcd
[language-typescript] Move the “Objects” section in `highlights.scm`…
savetheclocktower Jan 20, 2024
dcf451c
[language-python] Update to latest `tree-sitter-python`…
savetheclocktower Jan 20, 2024
5e84a7c
[language-shellscript] Highlighting fixes…
savetheclocktower Jan 20, 2024
5aef671
[language-php] Fix incorrect indentation after ternary expressions
savetheclocktower Jan 20, 2024
e874d51
[language-c] Update the `tree-sitter-c` and `tree-sitter-cpp` parsers
savetheclocktower Jan 20, 2024
aff27bb
[language-html] Update `tree-sitter-html` to latest
savetheclocktower Jan 20, 2024
38534bb
[language-ruby] Update `tree-sitter-ruby` to latest
savetheclocktower Jan 20, 2024
fd0b9a2
[language-ruby] Move files around to conform better to convention
savetheclocktower Jan 20, 2024
cf884f5
Update `tree-sitter-regex` for both JavaScript and Ruby
savetheclocktower Jan 20, 2024
c010993
(forgot to change this spec)
savetheclocktower Jan 20, 2024
81ca97e
[language-ruby] Tweak scope name for regex injections
savetheclocktower Jan 20, 2024
054b067
Update highlights for all regex injections…
savetheclocktower Jan 20, 2024
e1e12ff
[language-gfm] Test for undetected URLs in paragraphs…
savetheclocktower Jan 20, 2024
88ffe78
Fix issue where `suggestedIndentForBufferRow` uses the wrong tree…
savetheclocktower Jan 20, 2024
65de46f
[language-html] Update `tree-sitter-embedded-template` to latest…
savetheclocktower Jan 20, 2024
7130f77
[language-typescript] Highlight the wildcard import symbol
savetheclocktower Jan 20, 2024
c2fb307
[language-php] Small fixes…
savetheclocktower Jan 20, 2024
4d8a721
[language-c] Highlight struct designated initializers
savetheclocktower Jan 20, 2024
2a0ebac
An injection with no highlights query should still apply its root scope
savetheclocktower Jan 20, 2024
46877b0
[language-php] Add `meta.embedded.block`/`meta.embedded.line`…
savetheclocktower Jan 21, 2024
e48ac62
Correct the PHP delimiters in the integration test
savetheclocktower Jan 21, 2024
aeeb03a
Adopt the `support.storage` compromise found in legacy Tree-sitter…
savetheclocktower Jan 21, 2024
33f193c
[language-php] Update `tree-sitter-php` to latest
savetheclocktower Jan 21, 2024
8766102
Clip injection ranges to the bounds of the buffer when needed
savetheclocktower Jan 21, 2024
cc2785b
Log context when a parser fails to load
savetheclocktower Jan 21, 2024
8525a3f
[language-php] Move value type usages into `support.storage.type`
savetheclocktower Jan 21, 2024
1e7e135
[language-javascript] Ensure object properties are scoped as `entity`…
savetheclocktower Jan 21, 2024
e0009ce
Highlight JSON keys in `one-(dark|light)-ui`
savetheclocktower Jan 21, 2024
4c0e7dd
Highlight JSON keys in the other six builtin syntax themes…
savetheclocktower Jan 21, 2024
ee220dd
[language-gfm] Change scope for a horizontal rule…
savetheclocktower Jan 21, 2024
2aa0cea
[language-gfm] Actually change the scope name for a horizontal rule…
savetheclocktower Jan 21, 2024
6b89902
[language-php] Update `parserSource` field for internal PHP grammar
savetheclocktower Jan 21, 2024
e001521
A vain attempt to get the integration testing working for PHP
savetheclocktower Jan 22, 2024
317679e
Attempt to get video of integration test failure
savetheclocktower Jan 22, 2024
5fdcf62
Revert inadvertent change
savetheclocktower Jan 22, 2024
6466d25
Upload videos unless task is cancelled
savetheclocktower Jan 22, 2024
995196a
[language-c] Support declarations of pointers-of-pointers
savetheclocktower Jan 23, 2024
1b2163f
Stop ESLint from complaining about `require('atom')`
savetheclocktower Jan 23, 2024
a0595b2
[language-typescript] Use proper comment delimiters in TypeScript…
savetheclocktower Jan 24, 2024
f1ce722
[language-typescript] Various highlighting fixes…
savetheclocktower Jan 25, 2024
9265e5e
[language-css] Fix failure to scope the `foo` in `.div foo`…
savetheclocktower Jan 25, 2024
edf19b2
[language-php] Stop scoping all tokens `LIKE_THIS` as `constant`
savetheclocktower Jan 25, 2024
11910a1
[language-gfm] Change `markup.code` to `markup.raw`…
savetheclocktower Jan 27, 2024
476e784
[language-javascript] Two highlighting fixes…
savetheclocktower Jan 27, 2024
ff030d8
[language-javascript] Missed these renames
savetheclocktower Jan 27, 2024
ecf4fa3
Revert change to `indentLevelForLine`…
savetheclocktower Jan 27, 2024
312f627
[language-yaml] Scope unquoted strings as, well, `string.unquoted`
savetheclocktower Jan 27, 2024
483870d
[language-rust] Scope `&`s in references as operators
savetheclocktower Jan 27, 2024
5728b7f
[language-javascript] Update to latest `tree-sitter-jsdoc`
savetheclocktower Jan 27, 2024
adfdd05
Allow “half-covering” of scopes at the edges of injections
savetheclocktower Jan 27, 2024
6767cda
Fix indentation bug in `suggestedIndentForBufferRow`
savetheclocktower Jan 27, 2024
1f9ab20
[language-javascript] Highlight public fields in class bodies
savetheclocktower Jan 27, 2024
a8215f1
[language-java] Add highlights for variables…
savetheclocktower Jan 28, 2024
e547ace
[language-css] Highlighting fixes:
savetheclocktower Jan 28, 2024
f691cfc
Allow for any number of @_IGNORE_ capture names in a query…
savetheclocktower Jan 28, 2024
5855241
Fix issue with looking up objects in `atom.config`…
savetheclocktower Jan 28, 2024
e49b919
[language-(java|type)script] Add exhaustive indentation configuration
savetheclocktower Jan 28, 2024
94d41ce
[language-(java|type)script] Highlight array-destructured variables…
savetheclocktower Jan 28, 2024
2e36a24
[language-php] Remove `firstLineRegex` and `contentRegex`
savetheclocktower Jan 30, 2024
4f3bc68
Merge branch 'master' into tree-sitter-january
DeeDeeG Jan 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
DeeDeeG marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.ts
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ module.exports = {
asyncArrow: "always",
named: "never"
}],
"node/no-missing-require": [
"error",
{
allowModules: ["atom"]
}
],
"node/no-unpublished-require": [
"error",
{
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ jobs:
node ./rolling-release-binary-upload.js

- name: Upload Video Artifacts
# Run whether this job passed or failed, unless explicitly cancelled.
if: '!cancelled()'
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }} Videos
Copy link
Member

@DeeDeeG DeeDeeG Jan 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can support this. 👍

Optional-to-read commentary:

Seems kind of arbitrary to do this in this PR specifically, although I can imagine how it might have come up.

Nevertheless I am in favor of this, we basically want to upload these if they've been made. And if they haven't been made, the 'upload video artifacts' job just warns us about it. So, this is effectively a best-effort to upload the test vids whenever possible, which I can get behind.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I needed to see the integration test failures to know what on earth was going on, and this is just the PR where it happened.

Expand Down
2 changes: 1 addition & 1 deletion integration/workspace.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const languages = [
// {language: "mustache", code: '10', checks: {numeric: '10'}},
{language: "Objective C", code: '10', checks: {numeric: '10'}},
{language: "Perl", code: '10', checks: {numeric: '10'}},
{language: "PHP", code: '<? 10 %>', checks: {numeric: '10'}},
{language: "PHP", code: '<? $foo ?>', checks: {variable: '$foo'}},
DeeDeeG marked this conversation as resolved.
Show resolved Hide resolved
// {language: "property-list", code: '10', checks: {numeric: '10'}},
{language: "Python", code: '10', checks: {numeric: '10'}},
{language: "Ruby on Rails", code: '10', checks: {numeric: '10'}},
Expand Down
1 change: 1 addition & 0 deletions packages/atom-dark-syntax/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
@import "styles/syntax/base.less";
@import "styles/syntax/css.less";
@import "styles/syntax/html.less";
@import "styles/syntax/json.less";
6 changes: 6 additions & 0 deletions packages/atom-dark-syntax/styles/syntax/base.less
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@
&.syntax--italic {
font-style: italic;
}

// Horizontal rules in GFM used to be scoped as `comment.hr`. For continuity,
// we assign the color of a comment to this new scope.
&.syntax--horizontal-rule {
color: #8A8A8A;
}
}

// /* comment */
Expand Down
11 changes: 11 additions & 0 deletions packages/atom-dark-syntax/styles/syntax/json.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

.syntax--source.syntax--json {

// Color JSON keys differently from other strings.
.syntax--meta.syntax--structure.syntax--key {
.syntax--string.syntax--quoted.syntax--double {
color: #96CBFE;
}
}

}
1 change: 1 addition & 0 deletions packages/atom-light-syntax/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@

@import "styles/syntax/base.less";
@import "styles/syntax/css.less";
@import "styles/syntax/json.less";
6 changes: 6 additions & 0 deletions packages/atom-light-syntax/styles/syntax/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@
&.syntax--italic {
font-style: italic;
}

// Horizontal rules in GFM used to be scoped as `comment.hr`. For continuity,
// we assign the color of a comment to this new scope.
&.syntax--horizontal-rule {
color: #999988;
}
}

// /* comment */
Expand Down
11 changes: 11 additions & 0 deletions packages/atom-light-syntax/styles/syntax/json.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

.syntax--source.syntax--json {

// Color JSON keys differently from other strings.
.syntax--meta.syntax--structure.syntax--key {
.syntax--string.syntax--quoted.syntax--double {
color: #008080;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@
&.syntax--raw {
color: @green;
}

// Horizontal rules in GFM used to be scoped as `comment.hr`. For continuity,
// we assign the color of a comment to this new scope.
&.syntax--horizontal-rule {
color: @gray;
}
}

.syntax--source.syntax--gfm {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
}
}

// Color JSON keys differently from other strings.
.syntax--meta.syntax--structure.syntax--key {
.syntax--string.syntax--quoted.syntax--double {
color: @red;
}
}

.syntax--meta.syntax--structure.syntax--dictionary.syntax--json, .syntax--meta.syntax--structure.syntax--array.syntax--json {
& > .syntax--value.syntax--json > .syntax--string.syntax--quoted.syntax--json,
& > .syntax--value.syntax--json > .syntax--string.syntax--quoted.syntax--json > .syntax--punctuation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@
&.syntax--raw {
color: @green;
}

// Horizontal rules in GFM used to be scoped as `comment.hr`. For continuity,
// we assign the color of a comment to this new scope.
&.syntax--horizontal-rule {
color: @gray;
}
}

.syntax--source.syntax--gfm {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
}
}

// Color JSON keys differently from other strings.
.syntax--meta.syntax--structure.syntax--key {
.syntax--string.syntax--quoted.syntax--double {
color: @red;
}
}

.syntax--meta.syntax--structure.syntax--dictionary.syntax--json, .syntax--meta.syntax--structure.syntax--array.syntax--json {
& > .syntax--value.syntax--json > .syntax--string.syntax--quoted.syntax--json,
& > .syntax--value.syntax--json > .syntax--string.syntax--quoted.syntax--json > .syntax--punctuation {
Expand Down
12 changes: 12 additions & 0 deletions packages/bracket-matcher/spec/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
env: { jasmine: true },
globals: {
waitsForPromise: true,
},
rules: {
"node/no-unpublished-require": "off",
"node/no-extraneous-require": "off",
"no-unused-vars": "off",
"no-empty": "off"
}
};
1 change: 1 addition & 0 deletions packages/language-c/grammars/modern-tree-sitter-c.cson
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ firstLineRegex: '-\\*-[^*]*(Mode:\\s*)?C(\\s*;.*?)?\\s*-\\*-'
injectionRegex: '^(c|C)$'

treeSitter:
parserSource: 'github:tree-sitter/tree-sitter-c#212a80f86452bb1316324fa0db730cf52f29e05a'
DeeDeeG marked this conversation as resolved.
Show resolved Hide resolved
grammar: 'tree-sitter-c/tree-sitter-c.wasm'
highlightsQuery: 'tree-sitter-c/highlights.scm'
tagsQuery: 'tree-sitter-c/tags.scm'
Expand Down
2 changes: 1 addition & 1 deletion packages/language-c/grammars/modern-tree-sitter-cpp.cson
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ parser: 'tree-sitter-cpp'
injectionRegex: '^(c|C)(\\+\\+|pp|PP)$'

treeSitter:
parserSource: 'github:tree-sitter/tree-sitter-cpp#a90f170f92d5d70e7c2d4183c146e61ba5f3a457'
parserSource: 'github:tree-sitter/tree-sitter-cpp#a71474021410973b29bfe99440d57bcd750246b1'
grammar: 'tree-sitter-cpp/tree-sitter-cpp.wasm'
highlightsQuery: 'tree-sitter-cpp/highlights.scm'
tagsQuery: 'tree-sitter-cpp/tags.scm'
Expand Down
109 changes: 84 additions & 25 deletions packages/language-c/grammars/tree-sitter-c/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"#define" @keyword.control.directive.define.c
"#include" @keyword.control.directive.include.c

(["#if" "#ifdef" "#ifndef" "#endif" "#elif" "#else" "#define" "#include"] @punctuation.definition.directive.c
(#set! adjust.endAfterFirstMatchOf "^#"))


; This will match if the more specific rules above haven't matched. The
; anonymous nodes will match under ideal conditions, but might not be present
; if the parser is flummoxed.
Expand Down Expand Up @@ -43,30 +47,41 @@
(type_identifier) @_IGNORE_
(#set! capture.final true))

(primitive_type) @support.type.builtin.c
(type_identifier) @support.type.other.c
(primitive_type) @support.storage.type.builtin.c
(type_identifier) @support.other.storage.type.c

; These types are all reserved words; if we see an identifier with this name,
; it must be a type.
((identifier) @support.type.builtin.c
(#match? @support.type.builtin.c "^(char|int|float|double|long)$"))
((identifier) @support.storage.type.builtin.c
(#match? @support.storage.type.builtin.c "^(char|int|float|double|long)$"))

; Assume any identifier that ends in `_t` is a type. This convention is not
; always followed, but it's a very strong indicator when it's present.
((identifier) @support.type.other.c
(#match? @support.type.other.c "_t$"))
((identifier) @support.other.storage.type.c
(#match? @support.other.storage.type.c "_t$"))

; These refer to language constructs and remain in the `storage` namespace.
[
"enum"
"long"
"short"
"signed"
"struct"
"typedef"
"union"
"unsigned"
] @storage.type.c

; These refer to value types and go under `support`.
[
"long"
"short"
] @support.storage.type.builtin.c

; These act as modifiers to value types and also go under `support`.
[
"signed"
"unsigned"
] @support.storage.modifier.builtin.c

; These act as general language modifiers and remain in the `storage`
; namespace.
[
"const"
"extern"
Expand All @@ -75,10 +90,10 @@
"restrict"
"static"
"volatile"
] @storage.modifier.c
] @storage.modifier._TYPE_.c

((primitive_type) @support.type.stdint.c
(#match? @support.type.stdint.c "^(int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t|uintmax_t|uintmax_t)$"))
((primitive_type) @support.storage.type.stdint.c
(#match? @support.storage.type.stdint.c "^(int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t|uintmax_t|uintmax_t)$"))

(enum_specifier
name: (type_identifier) @variable.other.declaration.type.c)
Expand Down Expand Up @@ -116,32 +131,57 @@
; Declarations and assignments
; ----------------------------

; The "x" in `int x`;
; The "x" in `int x;`
(declaration
declarator: (identifier) @variable.declaration.c)

; The "x" in `int x = y`;
; The "x" in `int x = y;`
(init_declarator
declarator: (identifier) @variable.declaration.c)

; The "x" in `SomeType *x;`
; (Should work no matter how many pointers deep we are.)
(pointer_declarator
declarator: [(identifier) (field_identifier)] @variable.declaration.pointer.c
(#is? test.descendantOfType "declaration field_declaration"))

; A member of a struct.
(field_declaration
(field_identifier) @entity.other.attribute-name.c)
(field_identifier) @variable.declaration.member.c)

; An attribute in a C99 struct designated initializer:
; the "foo" in `MY_TYPE a = { .foo = true };
(initializer_pair
(field_designator
(field_identifier) @variable.declaration.member.c))

; (and the associated ".")
(initializer_pair
(field_designator
"." @keyword.operator.accessor.c))

(field_declaration
(pointer_declarator
(field_identifier) @entity.other.attribute-name.c))
(field_identifier) @variable.declaration.member.c))

(field_declaration
(array_declarator
(field_identifier) @entity.other.attribute-name.c))
(field_identifier) @variable.declaration.member.c))

(init_declarator
(pointer_declarator
(identifier) @entity.other.attribute-name.c))
(identifier) @variable.declaration.member.c))

; The "x" in `x = y;`
(assignment_expression
left: (identifier) @variable.other.assignment.c)

; The "foo" in `something->foo = "bar";`
(assignment_expression
left: (field_expression
field: (field_identifier) @variable.other.member.assignment.c)
(#set! capture.final))


; Function parameters
; -------------------
Expand All @@ -154,9 +194,10 @@
declarator: (identifier) @variable.parameter.c)

; The "foo" in `const char *foo` within a parameter list.
(parameter_declaration
declarator: (pointer_declarator
declarator: (identifier) @variable.parameter.c))
; (Should work no matter how many pointers deep we are.)
(pointer_declarator
declarator: [(identifier) (field_identifier)] @variable.parameter.pointer.c
(#is? test.descendantOfType "parameter_declaration"))

; The "foo" in `const char foo[]` within a parameter list.
(parameter_declaration
Expand All @@ -172,7 +213,7 @@
; The "size" in `finfo->size`.
(field_expression
"->"
field: (field_identifier) @support.other.property.c)
field: (field_identifier) @variable.other.member.c)


; FUNCTIONS
Expand Down Expand Up @@ -309,8 +350,10 @@

";" @punctuation.terminator.statement.c

"," @punctuation.separator.comma.c
"->" @punctuation.separator.pointer-access.c
("," @punctuation.separator.comma.c
(#set! capture.shy))
("->" @keyword.operator.accessor.pointer-access.c
(#set! capture.shy))

(parameter_list
"(" @punctuation.definition.parameters.begin.bracket.round.c
Expand All @@ -335,6 +378,22 @@
"[" @punctuation.definition.array.begin.bracket.square.c
"]" @punctuation.definition.array.end.bracket.square.c


; META
; ====

((compound_statement) @meta.block.c
(#set! adjust.startAt firstChild.endPosition)
(#set! adjust.endAt lastChild.startPosition))

((enumerator_list) @meta.block.enum.c
(#set! adjust.startAt firstChild.endPosition)
(#set! adjust.endAt lastChild.startPosition))

((field_declaration_list) @meta.block.field.c
(#set! adjust.startAt firstChild.endPosition)
(#set! adjust.endAt lastChild.startPosition))

; TODO:
;
; * TM-style grammar has a lot of `mac-classic` scopes. I doubt they'd be
Expand Down
Binary file modified packages/language-c/grammars/tree-sitter-c/tree-sitter-c.wasm
Binary file not shown.
Loading
Loading