diff --git a/grammars/javascript.cson b/grammars/javascript.cson index 150e94c1..ba4272c3 100644 --- a/grammars/javascript.cson +++ b/grammars/javascript.cson @@ -1605,7 +1605,7 @@ 'name': 'storage.type.class.jsdoc' } { - 'match': '({\\b(?:[a-zA-Z_$][\\w$]*)\\b})\\s+(\\[\\b(?:[a-zA-Z_$]+(?:=[\\w][\\s\\w$]*)?)\\b\\]|\\b(?:[a-zA-Z_$][\\w$]*)\\b)\\s*((?:(?!\\*\\/).)*)' + 'match': '({\\b(?:[a-zA-Z_$][\\w$]*)\\b})\\s+(\\[\\b(?:[a-zA-Z_$]+(?:=[\\w][\\s\\w$]*)?)\\b\\]|\\b(?:[a-zA-Z_$][\\w$]*(?:\\.[a-zA-Z_$][\\w$]*)*)\\b)\\s*((?:(?!\\*\\/).)*)' 'captures': 0: 'name': 'other.meta.jsdoc' diff --git a/spec/javascript-spec.coffee b/spec/javascript-spec.coffee index b68a7e4e..f63f62bd 100644 --- a/spec/javascript-spec.coffee +++ b/spec/javascript-spec.coffee @@ -1519,6 +1519,11 @@ describe "Javascript grammar", -> expect(tokens[6]).toEqual value: '[variable=default value]', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'variable.other.jsdoc'] expect(tokens[8]).toEqual value: 'this is the description ', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'other.description.jsdoc'] + {tokens} = grammar.tokenizeLine('/** @param {object} parameter.property this is the description */') + expect(tokens[4]).toEqual value: '{object}', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'entity.name.type.instance.jsdoc'] + expect(tokens[6]).toEqual value: 'parameter.property', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'variable.other.jsdoc'] + expect(tokens[8]).toEqual value: 'this is the description ', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'other.description.jsdoc'] + it "tokenizes // comments", -> {tokens} = grammar.tokenizeLine('// comment') expect(tokens[0]).toEqual value: '//', scopes: ['source.js', 'comment.line.double-slash.js', 'punctuation.definition.comment.js']