From 9d7ab17c077cd33fce650b2b8a8d6ef8926363b0 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Tue, 27 Aug 2024 20:42:01 +0200 Subject: [PATCH] Fix at-function calls --- CoffeeScript.sublime-syntax | 4 +++- tests/syntax_test_scope.coffee | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) 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