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

Commit a33dcdc

Browse files
committed
✅ Add spec for JSDoc optional parameters
1 parent 52926a5 commit a33dcdc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

spec/javascript-spec.coffee

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,6 +1509,13 @@ describe "Javascript grammar", ->
15091509
expect(tokens[6]).toEqual value: 'variable', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'variable.other.jsdoc']
15101510
expect(tokens[8]).toEqual value: 'this is the description ', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'other.description.jsdoc']
15111511

1512+
{tokens} = grammar.tokenizeLine('/** @param {object} [variable] this is the description */')
1513+
expect(tokens[4]).toEqual value: '{object}', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'entity.name.type.instance.jsdoc']
1514+
expect(tokens[6]).toEqual value: '[variable]', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'variable.other.jsdoc']
1515+
expect(tokens[8]).toEqual value: 'this is the description ', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'other.description.jsdoc']
1516+
1517+
1518+
15121519
it "tokenizes // comments", ->
15131520
{tokens} = grammar.tokenizeLine('// comment')
15141521
expect(tokens[0]).toEqual value: '//', scopes: ['source.js', 'comment.line.double-slash.js', 'punctuation.definition.comment.js']

0 commit comments

Comments
 (0)