diff --git a/CoffeeScript.sublime-syntax b/CoffeeScript.sublime-syntax index 70c3c72..c62829b 100644 --- a/CoffeeScript.sublime-syntax +++ b/CoffeeScript.sublime-syntax @@ -302,8 +302,10 @@ contexts: | Uint(?: 8 | 16 | 32 | 64)Array | XMLHttpRequest | Symbol )\b scope: support.class.coffee # user function calls - - match: '{{identifier}}(?=\()' + - match: (@?){{identifier}}(?=\() scope: meta.function-call.identifier.coffee variable.function.coffee + captures: + 1: punctuation.definition.variable.coffee push: function-call-argument-list function-call-argument-list: diff --git a/tests/syntax_test_scope.coffee b/tests/syntax_test_scope.coffee index 0be4619..40b2fca 100644 --- a/tests/syntax_test_scope.coffee +++ b/tests/syntax_test_scope.coffee @@ -366,6 +366,33 @@ class App.Router extends Snakeskin.Router # ^ punctuation.section.group.begin.coffee # ^ punctuation.section.group.end.coffee +###[ USER FUNCTIONS ]########################################################## + + func() +# ^^^^ meta.function-call.identifier.coffee variable.function.coffee +# ^^ meta.function-call.arguments.coffee + + $func() +# ^^^^^ meta.function-call.identifier.coffee variable.function.coffee +# ^^ meta.function-call.arguments.coffee + + $('') +# ^ meta.function-call.identifier.coffee variable.function.coffee +# ^^^^ meta.function-call.arguments.coffee + + @name() +# ^^^^^ meta.function-call.identifier.coffee variable.function.coffee +# ^^ meta.function-call.arguments.coffee + + @$('#notification') +# ^^ meta.function-call.identifier.coffee variable.function.coffee +# ^^^^^^^^^^^^^^^^^ meta.function-call.arguments.coffee +# ^ punctuation.definition.variable.coffee +# ^ variable.function.coffee +# ^ punctuation.section.group.begin.coffee +# ^^^^^^^^^^^^^^^ meta.string.coffee string.quoted.single.coffee +# ^ punctuation.section.group.end.coffee + ###[ OBJECT MEMBERS ]########################################################## this.key