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

Commit 189ace1

Browse files
author
Ben Griffith
committed
✅ Add spec for dollar sign with JSDoc parameters
1 parent 94f93c1 commit 189ace1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

spec/javascript-spec.coffee

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,6 +1509,11 @@ 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+
15121517
{tokens} = grammar.tokenizeLine('/** @param {object} [variable] this is the description */')
15131518
expect(tokens[4]).toEqual value: '{object}', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'entity.name.type.instance.jsdoc']
15141519
expect(tokens[6]).toEqual value: '[variable]', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'variable.other.jsdoc']

0 commit comments

Comments
 (0)