Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 68c1f4a

Browse files
WliuWliu
Wliu
authored and
Wliu
committed
Merge pull request #218 from atom/wl-constructor-scope
Scope constructor to entity.name.function.constructor
2 parents 284f2ce + 3657a60 commit 68c1f4a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

grammars/javascript.cson

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@
265265
'begin': '\\b(constructor)\\s*(\\()'
266266
'beginCaptures':
267267
'1':
268-
'name': 'entity.name.constructor.js'
268+
'name': 'entity.name.function.constructor.js'
269269
'2':
270270
'name': 'punctuation.definition.parameters.begin.js'
271271
'end': '(\\))'

spec/javascript-spec.coffee

+1-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ describe "Javascript grammar", ->
367367

368368
it "tokenizes constructors", ->
369369
{tokens} = grammar.tokenizeLine('constructor(a, b)')
370-
expect(tokens[0]).toEqual value: 'constructor', scopes: ['source.js', 'entity.name.constructor.js']
370+
expect(tokens[0]).toEqual value: 'constructor', scopes: ['source.js', 'entity.name.function.constructor.js']
371371
expect(tokens[1]).toEqual value: '(', scopes: ['source.js', 'punctuation.definition.parameters.begin.js']
372372
expect(tokens[2]).toEqual value: 'a', scopes: ['source.js', 'variable.parameter.function.js']
373373
expect(tokens[3]).toEqual value: ',', scopes: ['source.js', 'meta.object.delimiter.js']

0 commit comments

Comments
 (0)