Skip to content

Commit

Permalink
Fix highlighting of class instantiation arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Oct 23, 2024
1 parent 70efe34 commit 0083361
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
15 changes: 14 additions & 1 deletion CoffeeScript.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,22 @@ contexts:
2: punctuation.accessor.dot.coffee
- match: '{{identifier}}'
scope: support.class.coffee
pop: 1
set: maybe-class-arguments
- include: else-pop

maybe-class-arguments:
- match: \(
scope: punctuation.section.group.begin.coffee
set: class-arguments-body
- include: else-pop

class-arguments-body:
- meta_scope: meta.group.coffee
- match: \)
scope: punctuation.section.group.end.coffee
pop: 1
- include: script

###[ OPERATORS ]##############################################################

punctuations:
Expand Down
11 changes: 10 additions & 1 deletion tests/syntax_test_scope.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,21 @@ class App.Router extends Snakeskin.Router
# ^ keyword.operator.assignment.coffee
# ^^^ keyword.operator.object.new.coffee
# ^^^^^ support.class.coffee
# ^ punctuation.section.group.begin.coffee
# ^ punctuation.section.group.end.coffee

try: new Class();
try: new Class("Unknown sort: #{info.type}");
# ^^^ variable.other.readwrite.coffee
# ^ keyword.operator.assignment.coffee
# ^^^ keyword.operator.object.new.coffee
# ^^^^^ support.class.coffee
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.group.coffee
# ^ punctuation.section.group.begin.coffee
# ^^^^^^^^^^^^^^^ meta.string.coffee string.quoted.double.coffee - meta.interpolation
# ^^^^^^^^^^^^ meta.string.coffee meta.embedded.coffee source.coffee.embedded.source
# ^ meta.string.coffee string.quoted.double.coffee - meta.interpolation
# ^ punctuation.section.group.end.coffee
# ^ punctuation.terminator.statement.coffee

###[ KEYWORDS ]################################################################

Expand Down

0 comments on commit 0083361

Please sign in to comment.