File tree Expand file tree Collapse file tree 2 files changed +35
-5
lines changed Expand file tree Collapse file tree 2 files changed +35
-5
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ repository:
101101 function-declaration :
102102 patterns :
103103 - name : meta.function
104- begin : (function)\s?(\w+)\((\w *)\)\s?\{
104+ begin : (function)\s?(\w+)\(([\w\s,] *)\)\s?\{
105105 beginCaptures :
106106 " 1 " : { name: storage.type.function }
107107 " 2 " : { name: entity.name.function }
@@ -209,15 +209,17 @@ repository:
209209 function-call :
210210 patterns :
211211 - name : meta.function-call
212- match : (\w+)\((.+)\ )
212+ match : (\w+)(\()([^)]*)(\) )
213213 captures :
214214 " 1 " : { name: entity.name.function }
215- " 2 " : { patterns: [{ include: "#expression" }] }
215+ " 2 " : { name: meta.brace.round }
216+ " 3 " : { patterns: [{ include: "#expression" }] }
217+ " 4 " : { name: meta.brace.round }
216218 - name : meta.function-call
217219 begin : (\w+)(\()
218220 beginCaptures :
219- " 0 " : { name: entity.name.function }
220- " 1 " : { name: meta.brace.round }
221+ " 1 " : { name: entity.name.function }
222+ " 2 " : { name: meta.brace.round }
221223 end : \)
222224 endCaptures :
223225 " 0 " : { name: meta.brace.round }
Original file line number Diff line number Diff line change 1+ // SYNTAX TEST "source.source" "function-call"
2+
3+ f()
4+ // <- entity.name.function
5+ // <~-- meta.brace.round
6+
7+ f(1)
8+ // <- entity.name.function
9+ // <~- meta.brace.round
10+ // <~~- constant.numeric.integer.decimal
11+ // ^ meta.brace.round
12+
13+ f(1, "hello")
14+ // <- entity.name.function
15+ // <~- meta.brace.round
16+ // <~~- constant.numeric.integer.decimal
17+ // ^^^^^^^ string.quoted.double
18+ // ^ meta.brace.round
19+
20+ f(
21+ // <~- meta.brace.round
22+ )
23+ // <- meta.brace.round
24+
25+ f(
26+ // <~- meta.brace.round
27+ g())
28+ // <~--- meta.brace.round
You can’t perform that action at this time.
0 commit comments