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

Commit 2a24cc2

Browse files
committed
✅ Add specs for improved JSDoc highlighting for return
1 parent 619316e commit 2a24cc2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

spec/javascript-spec.coffee

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,6 +1573,20 @@ describe "Javascript grammar", ->
15731573
expect(tokens[6]).toEqual value: 'variable', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'variable.other.jsdoc']
15741574
expect(tokens[8]).toEqual value: 'this is the description ', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'other.description.jsdoc']
15751575

1576+
{tokens} = grammar.tokenizeLine('/** @return {object} this is the description */')
1577+
expect(tokens[4]).toEqual value: '{object}', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'entity.name.type.instance.jsdoc']
1578+
expect(tokens[6]).toEqual value: 'this is the description ', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'other.description.jsdoc']
1579+
1580+
{tokens} = grammar.tokenizeLine('/** @return {object} */')
1581+
expect(tokens[4]).toEqual value: '{object}', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'entity.name.type.instance.jsdoc']
1582+
1583+
{tokens} = grammar.tokenizeLine('/** @returns {object} this is the description */')
1584+
expect(tokens[4]).toEqual value: '{object}', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'entity.name.type.instance.jsdoc']
1585+
expect(tokens[6]).toEqual value: 'this is the description ', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'other.description.jsdoc']
1586+
1587+
{tokens} = grammar.tokenizeLine('/** @returns {object} */')
1588+
expect(tokens[4]).toEqual value: '{object}', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'entity.name.type.instance.jsdoc']
1589+
15761590
it "tokenizes // comments", ->
15771591
{tokens} = grammar.tokenizeLine('// comment')
15781592
expect(tokens[0]).toEqual value: '//', scopes: ['source.js', 'comment.line.double-slash.js', 'punctuation.definition.comment.js']

0 commit comments

Comments
 (0)