@@ -936,6 +936,36 @@ describe "JSDoc grammar", ->
936936 expect (tokens[7 ]).toEqual value : ' }' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' , ' punctuation.definition.bracket.curly.end.jsdoc' ]
937937 expect (tokens[9 ]).toEqual value : ' variable' , scopes : [' source.js' , ' comment.block.documentation.js' , ' variable.other.jsdoc' ]
938938
939+ {tokens } = grammar .tokenizeLine (' /** @param {\n number\n } variable this is the description */' )
940+ expect (tokens[5 ]).toEqual value : ' {' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' , ' punctuation.definition.bracket.curly.begin.jsdoc' ]
941+ expect (tokens[6 ]).toEqual value : ' \n number\n ' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' ]
942+ expect (tokens[7 ]).toEqual value : ' }' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' , ' punctuation.definition.bracket.curly.end.jsdoc' ]
943+ expect (tokens[9 ]).toEqual value : ' variable' , scopes : [' source.js' , ' comment.block.documentation.js' , ' variable.other.jsdoc' ]
944+
945+ {tokens } = grammar .tokenizeLine (' /** @param {{number}} variable this is the description */' )
946+ expect (tokens[5 ]).toEqual value : ' {' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' , ' punctuation.definition.bracket.curly.begin.jsdoc' ]
947+ expect (tokens[6 ]).toEqual value : ' {' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' ]
948+ expect (tokens[7 ]).toEqual value : ' number' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' ]
949+ expect (tokens[8 ]).toEqual value : ' }' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' ]
950+ expect (tokens[9 ]).toEqual value : ' }' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' , ' punctuation.definition.bracket.curly.end.jsdoc' ]
951+ expect (tokens[11 ]).toEqual value : ' variable' , scopes : [' source.js' , ' comment.block.documentation.js' , ' variable.other.jsdoc' ]
952+
953+ {tokens } = grammar .tokenizeLine (' /** @param {{\n * number\n * }} variable this is the description */' )
954+ expect (tokens[5 ]).toEqual value : ' {' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' , ' punctuation.definition.bracket.curly.begin.jsdoc' ]
955+ expect (tokens[6 ]).toEqual value : ' {' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' ]
956+ expect (tokens[8 ]).toEqual value : ' *' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' , ' comment.block.documentation.jsdoc' ]
957+ expect (tokens[9 ]).toEqual value : ' number\n ' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' ]
958+ expect (tokens[10 ]).toEqual value : ' *' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' , ' comment.block.documentation.jsdoc' ]
959+ expect (tokens[12 ]).toEqual value : ' }' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' ]
960+ expect (tokens[13 ]).toEqual value : ' }' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' , ' punctuation.definition.bracket.curly.end.jsdoc' ]
961+ expect (tokens[15 ]).toEqual value : ' variable' , scopes : [' source.js' , ' comment.block.documentation.js' , ' variable.other.jsdoc' ]
962+
963+ {tokens } = grammar .tokenizeLine (' /** @param {{\n */ foo' )
964+ expect (tokens[5 ]).toEqual value : ' {' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' , ' punctuation.definition.bracket.curly.begin.jsdoc' ]
965+ expect (tokens[6 ]).toEqual value : ' {' , scopes : [' source.js' , ' comment.block.documentation.js' , ' entity.name.type.instance.jsdoc' ]
966+ expect (tokens[8 ]).toEqual value : ' */' , scopes : [' source.js' , ' comment.block.documentation.js' , ' punctuation.section.end.comment.js' ]
967+ expect (tokens[9 ]).toEqual value : ' foo' , scopes : [' source.js' ]
968+
939969 it " tokenises @return tags without descriptions" , ->
940970 {tokens } = grammar .tokenizeLine (' /** @return {object} */' )
941971 expect (tokens[0 ]).toEqual value : ' /**' , scopes : [' source.js' , ' comment.block.documentation.js' , ' punctuation.section.begin.comment.js' ]
0 commit comments