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

Commit a86ab62

Browse files
author
Ben Griffith
committed
✅ Add spec for use of spread operator as prefix of JSDoc type
1 parent c752308 commit a86ab62

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
@@ -1549,6 +1549,11 @@ describe "Javascript grammar", ->
15491549
expect(tokens[6]).toEqual value: 'variable', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'variable.other.jsdoc']
15501550
expect(tokens[8]).toEqual value: 'this is the description ', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'other.description.jsdoc']
15511551

1552+
{tokens} = grammar.tokenizeLine('/** @param {...number} variable this is the description */')
1553+
expect(tokens[4]).toEqual value: '{...number}', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'entity.name.type.instance.jsdoc']
1554+
expect(tokens[6]).toEqual value: 'variable', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'variable.other.jsdoc']
1555+
expect(tokens[8]).toEqual value: 'this is the description ', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'other.description.jsdoc']
1556+
15521557
it "tokenizes // comments", ->
15531558
{tokens} = grammar.tokenizeLine('// comment')
15541559
expect(tokens[0]).toEqual value: '//', scopes: ['source.js', 'comment.line.double-slash.js', 'punctuation.definition.comment.js']

0 commit comments

Comments
 (0)