-
-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathscala.scm
66 lines (56 loc) · 1.16 KB
/
scala.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
;; https://github.com/tree-sitter/tree-sitter-scala/blob/master/src/grammar.json
(if_expression) @ifStatement
[
(string)
(interpolated_string_expression)
] @string @textFragment
(comment) @comment @textFragment
;; treating classes = classlike
[
(class_definition
name: (_) @className
)
(object_definition
name: (_) @className
)
(trait_definition
name: (_) @className
)
] @class @className.domain
;; list.size(), does not count foo.size (field_expression), or foo size (postfix_expression)
(call_expression) @functionCall
(lambda_expression) @anonymousFunction
(function_definition
name: (_) @functionName
) @namedFunction @functionName.domain
(match_expression
value: (_) @private.switchStatementSubject
) @_.domain
(_
name: (_) @name
) @_.domain
(_
pattern: (_) @name
) @_.domain
operator: (operator_identifier) @disqualifyDelimiter
(enumerator
"<-" @disqualifyDelimiter
)
(view_bound
"<%" @disqualifyDelimiter
)
(upper_bound
"<:" @disqualifyDelimiter
)
(lower_bound
">:" @disqualifyDelimiter
)
(lambda_expression
"=>" @disqualifyDelimiter
)
(function_type
"=>" @disqualifyDelimiter
)
(case_clause
"=>" @disqualifyDelimiter
)