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

Commit 8b64904

Browse files
committed
✅ Add spec for square bracket suffix in JSDoc type
1 parent e20e6bb commit 8b64904

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: spec/javascript-spec.coffee

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

1562+
{tokens} = grammar.tokenizeLine('/** @param {number[]} variable this is the description */')
1563+
expect(tokens[4]).toEqual value: '{number[]}', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'entity.name.type.instance.jsdoc']
1564+
expect(tokens[6]).toEqual value: 'variable', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'variable.other.jsdoc']
1565+
expect(tokens[8]).toEqual value: 'this is the description ', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'other.description.jsdoc']
1566+
15621567
it "tokenizes // comments", ->
15631568
{tokens} = grammar.tokenizeLine('// comment')
15641569
expect(tokens[0]).toEqual value: '//', scopes: ['source.js', 'comment.line.double-slash.js', 'punctuation.definition.comment.js']

0 commit comments

Comments
 (0)