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

Commit 132dae0

Browse files
committed
✅ Add spec for alternative optional JSDoc type syntax
1 parent 3d7bfe1 commit 132dae0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

spec/javascript-spec.coffee

+5
Original file line numberDiff line numberDiff line change
@@ -1554,6 +1554,11 @@ describe "Javascript grammar", ->
15541554
expect(tokens[6]).toEqual value: 'variable', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'variable.other.jsdoc']
15551555
expect(tokens[8]).toEqual value: 'this is the description ', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'other.description.jsdoc']
15561556

1557+
{tokens} = grammar.tokenizeLine('/** @param {number=} variable this is the description */')
1558+
expect(tokens[4]).toEqual value: '{number=}', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'entity.name.type.instance.jsdoc']
1559+
expect(tokens[6]).toEqual value: 'variable', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'variable.other.jsdoc']
1560+
expect(tokens[8]).toEqual value: 'this is the description ', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'other.description.jsdoc']
1561+
15571562
it "tokenizes // comments", ->
15581563
{tokens} = grammar.tokenizeLine('// comment')
15591564
expect(tokens[0]).toEqual value: '//', scopes: ['source.js', 'comment.line.double-slash.js', 'punctuation.definition.comment.js']

0 commit comments

Comments
 (0)