Skip to content

Commit 263ce72

Browse files
authored
Merge pull request #321 from natsukagami/use-match
Use match? instead of lua-match? for queries
2 parents cda0de8 + 25f8fdf commit 263ce72

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

queries/scala/highlights.scm

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,18 @@
6464
((stable_identifier (identifier) @namespace))
6565

6666
((import_declaration
67-
path: (identifier) @type) (#lua-match? @type "^[A-Z]"))
68-
((stable_identifier (identifier) @type) (#lua-match? @type "^[A-Z]"))
67+
path: (identifier) @type) (#match? @type "^[A-Z]"))
68+
((stable_identifier (identifier) @type) (#match? @type "^[A-Z]"))
6969

7070
(export_declaration
7171
path: (identifier) @namespace)
7272
((stable_identifier (identifier) @namespace))
7373

7474
((export_declaration
75-
path: (identifier) @type) (#lua-match? @type "^[A-Z]"))
76-
((stable_identifier (identifier) @type) (#lua-match? @type "^[A-Z]"))
75+
path: (identifier) @type) (#match? @type "^[A-Z]"))
76+
((stable_identifier (identifier) @type) (#match? @type "^[A-Z]"))
7777

78-
((namespace_selectors (identifier) @type) (#lua-match? @type "^[A-Z]"))
78+
((namespace_selectors (identifier) @type) (#match? @type "^[A-Z]"))
7979

8080
; method invocation
8181

@@ -91,7 +91,7 @@
9191

9292
((call_expression
9393
function: (identifier) @constructor)
94-
(#lua-match? @constructor "^[A-Z]"))
94+
(#match? @constructor "^[A-Z]"))
9595

9696
(generic_function
9797
function: (identifier) @function.call)
@@ -114,7 +114,7 @@
114114

115115
(field_expression field: (identifier) @property)
116116
(field_expression value: (identifier) @type
117-
(#lua-match? @type "^[A-Z]"))
117+
(#match? @type "^[A-Z]"))
118118

119119
(infix_expression operator: (identifier) @operator)
120120
(infix_expression operator: (operator_identifier) @operator)
@@ -245,13 +245,13 @@
245245

246246
(operator_identifier) @operator
247247

248-
((identifier) @type (#lua-match? @type "^[A-Z]"))
248+
((identifier) @type (#match? @type "^[A-Z]"))
249249
((identifier) @variable.builtin
250-
(#lua-match? @variable.builtin "^this$"))
250+
(#match? @variable.builtin "^this$"))
251251

252252
(
253253
(identifier) @function.builtin
254-
(#lua-match? @function.builtin "^super$")
254+
(#match? @function.builtin "^super$")
255255
)
256256

257257
;; Scala CLI using directives

test/highlight/scala3.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ object O2:
3636
// SIP-44
3737
class C:
3838
// ^keyword
39+
// ^type
3940
fooooo.map: x =>
40-
// ^type
4141
// ^method.call
4242
x + 1
4343

0 commit comments

Comments
 (0)