Skip to content

Commit 9d7ab17

Browse files
committed
Fix at-function calls
1 parent 59f5968 commit 9d7ab17

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

CoffeeScript.sublime-syntax

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,10 @@ contexts:
302302
| Uint(?: 8 | 16 | 32 | 64)Array | XMLHttpRequest | Symbol )\b
303303
scope: support.class.coffee
304304
# user function calls
305-
- match: '{{identifier}}(?=\()'
305+
- match: (@?){{identifier}}(?=\()
306306
scope: meta.function-call.identifier.coffee variable.function.coffee
307+
captures:
308+
1: punctuation.definition.variable.coffee
307309
push: function-call-argument-list
308310

309311
function-call-argument-list:

tests/syntax_test_scope.coffee

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,33 @@ class App.Router extends Snakeskin.Router
366366
# ^ punctuation.section.group.begin.coffee
367367
# ^ punctuation.section.group.end.coffee
368368

369+
###[ USER FUNCTIONS ]##########################################################
370+
371+
func()
372+
# ^^^^ meta.function-call.identifier.coffee variable.function.coffee
373+
# ^^ meta.function-call.arguments.coffee
374+
375+
$func()
376+
# ^^^^^ meta.function-call.identifier.coffee variable.function.coffee
377+
# ^^ meta.function-call.arguments.coffee
378+
379+
$('')
380+
# ^ meta.function-call.identifier.coffee variable.function.coffee
381+
# ^^^^ meta.function-call.arguments.coffee
382+
383+
@name()
384+
# ^^^^^ meta.function-call.identifier.coffee variable.function.coffee
385+
# ^^ meta.function-call.arguments.coffee
386+
387+
@$('#notification')
388+
# ^^ meta.function-call.identifier.coffee variable.function.coffee
389+
# ^^^^^^^^^^^^^^^^^ meta.function-call.arguments.coffee
390+
# ^ punctuation.definition.variable.coffee
391+
# ^ variable.function.coffee
392+
# ^ punctuation.section.group.begin.coffee
393+
# ^^^^^^^^^^^^^^^ meta.string.coffee string.quoted.single.coffee
394+
# ^ punctuation.section.group.end.coffee
395+
369396
###[ OBJECT MEMBERS ]##########################################################
370397

371398
this.key

0 commit comments

Comments
 (0)