@@ -123,6 +123,25 @@ describe "JSDoc grammar", ->
123123 expect (tokens[20 ]).toEqual value : ' . ' , scopes : [' source.js' , ' comment.block.documentation.js' ]
124124 expect (tokens[21 ]).toEqual value : ' */' , scopes : [' source.js' , ' comment.block.documentation.js' , ' punctuation.section.end.comment.js' ]
125125
126+ it " tokenises inline tags within default @param values" , ->
127+ {tokens } = grammar .tokenizeLine (' /** @param {EntityType} [typeHint={@link EntityType.FILE}] */' )
128+ expect (tokens[0 ]).toEqual value : ' /**' , scopes : [' source.js' , ' comment.block.documentation.js' , ' punctuation.section.begin.comment.js' ]
129+ expect (tokens[2 ]).toEqual value : ' @' , scopes : [' source.js' , ' comment.block.documentation.js' , ' storage.type.class.jsdoc' , ' punctuation.definition.block.tag.jsdoc' ]
130+ expect (tokens[3 ]).toEqual value : ' param' , scopes : [' source.js' , ' comment.block.documentation.js' , ' storage.type.class.jsdoc' ]
131+ expect (tokens[5 ]).toEqual value : ' {' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' , ' punctuation.definition.bracket.curly.begin.jsdoc' ]
132+ expect (tokens[6 ]).toEqual value : ' EntityType' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' ]
133+ expect (tokens[7 ]).toEqual value : ' }' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' , ' punctuation.definition.bracket.curly.end.jsdoc' ]
134+ expect (tokens[9 ]).toEqual value : ' [' , scopes : [' source.js' , ' comment.block.documentation.js' , ' variable.other.jsdoc' ]
135+ expect (tokens[10 ]).toEqual value : ' typeHint' , scopes : [' source.js' , ' comment.block.documentation.js' , ' variable.other.jsdoc' ]
136+ expect (tokens[11 ]).toEqual value : ' =' , scopes : [' source.js' , ' comment.block.documentation.js' , ' variable.other.jsdoc' , ' keyword.operator.assignment.jsdoc' ]
137+ expect (tokens[12 ]).toEqual value : ' {' , scopes : [' source.js' , ' comment.block.documentation.js' , ' variable.other.jsdoc' , ' source.embedded.js' , ' entity.name.type.instance.jsdoc' , ' punctuation.definition.bracket.curly.begin.jsdoc' ]
138+ expect (tokens[13 ]).toEqual value : ' @' , scopes : [' source.js' , ' comment.block.documentation.js' , ' variable.other.jsdoc' , ' source.embedded.js' , ' entity.name.type.instance.jsdoc' , ' storage.type.class.jsdoc' , ' punctuation.definition.inline.tag.jsdoc' ]
139+ expect (tokens[14 ]).toEqual value : ' link' , scopes : [' source.js' , ' comment.block.documentation.js' , ' variable.other.jsdoc' , ' source.embedded.js' , ' entity.name.type.instance.jsdoc' , ' storage.type.class.jsdoc' ]
140+ expect (tokens[16 ]).toEqual value : ' EntityType.FILE' , scopes : [' source.js' , ' comment.block.documentation.js' , ' variable.other.jsdoc' , ' source.embedded.js' , ' entity.name.type.instance.jsdoc' , ' variable.other.description.jsdoc' ]
141+ expect (tokens[17 ]).toEqual value : ' }' , scopes : [' source.js' , ' comment.block.documentation.js' , ' variable.other.jsdoc' , ' source.embedded.js' , ' entity.name.type.instance.jsdoc' , ' punctuation.definition.bracket.curly.end.jsdoc' ]
142+ expect (tokens[18 ]).toEqual value : ' ]' , scopes : [' source.js' , ' comment.block.documentation.js' , ' variable.other.jsdoc' ]
143+ expect (tokens[20 ]).toEqual value : ' */' , scopes : [' source.js' , ' comment.block.documentation.js' , ' punctuation.section.end.comment.js' ]
144+
126145 describe " block tags" , ->
127146 it " tokenises simple tags" , ->
128147 {tokens } = grammar .tokenizeLine (' /** @mixins */' )
0 commit comments