Skip to content

Commit e641540

Browse files
authored
Fix highlighting of constructor function if class is nameless (#258)
1 parent 25621d4 commit e641540

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CoffeeScript.sublime-syntax

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ contexts:
102102
- class-name
103103

104104
class-name:
105+
- match: $
106+
pop: 1
105107
- match: (?=extends\b)
106108
pop: 1
107109
- match: ({{identifier}})(\.)

tests/syntax_test_scope.coffee

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ class App.Router extends Snakeskin.Router
6767
# ^ punctuation.accessor.dot.coffee
6868
# ^^^^^^ entity.other.inherited-class.coffee
6969

70+
class
71+
# <- meta.class.coffee keyword.declaration.class.coffee
72+
constructor: ->
73+
# ^ meta.function.identifier.coffee entity.name.function.coffee
74+
7075
###[ FUNCTIONS ]###############################################################
7176

7277
name:

0 commit comments

Comments
 (0)