Skip to content

Commit

Permalink
Fix at-function calls
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Aug 27, 2024
1 parent 59f5968 commit 9d7ab17
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CoffeeScript.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
27 changes: 27 additions & 0 deletions tests/syntax_test_scope.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9d7ab17

Please sign in to comment.