Skip to content

Commit

Permalink
lang: dart: corrections to local scope
Browse files Browse the repository at this point in the history
  • Loading branch information
flukejones committed Dec 17, 2021
1 parent 310ffda commit e135e64
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
1 change: 1 addition & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ roots = []

indent = { tab-width = 2, unit = " " }

[[language]]
name = "dart"
scope = "source.dart"
file-types = ["dart"]
Expand Down
4 changes: 4 additions & 0 deletions runtime/queries/dart/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@
"with"
] @keyword

; when used as an identifier:
((identifier) @variable.builtin
(#match? @variable.builtin "^(abstract|as|covariant|deferred|dynamic|export|external|factory|Function|get|implements|import|interface|library|operator|mixin|part|set|static|typedef)$"))

; Error
(ERROR) @error

22 changes: 17 additions & 5 deletions runtime/queries/dart/locals.scm
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
; Scopes
;-------

[
(block)
(try_statement)
(catch_clause)
(finally_clause)
] @local.scope

; Definitions
;------------

(class_definition
body: (_) @scope)
body: (_) @local.definition)

(block) @scope
; References
;------------

(try_statement) @scope
(catch_clause) @scope
(finally_clause) @scope
(identifier) @local.reference

0 comments on commit e135e64

Please sign in to comment.