diff --git a/grammars/javascript.cson b/grammars/javascript.cson index 6ec36c23..b81267a7 100644 --- a/grammars/javascript.cson +++ b/grammars/javascript.cson @@ -1605,7 +1605,7 @@ 'name': 'storage.type.class.jsdoc' } { - 'match': '({(?:\\*|(?:\\?|\\!|\\.{3})?[a-zA-Z_$][\\w$]*(?:\\.[a-zA-Z_$][\\w$]*)*)})\\s+(\\[(?:[a-zA-Z_$]+(?:=[\\w][\\s\\w$]*)?)\\]|(?:[a-zA-Z_$][\\w$]*(?:\\.[a-zA-Z_$][\\w$]*)*))\\s*((?:(?!\\*\\/).)*)' + 'match': '({(?:\\*|(?:\\?|\\!|\\.{3})?[a-zA-Z_$][\\w$]*(?:\\.[a-zA-Z_$][\\w$]*)*=?)})\\s+(\\[(?:[a-zA-Z_$]+(?:=[\\w][\\s\\w$]*)?)\\]|(?:[a-zA-Z_$][\\w$]*(?:\\.[a-zA-Z_$][\\w$]*)*))\\s*((?:(?!\\*\\/).)*)' 'captures': 0: 'name': 'other.meta.jsdoc' diff --git a/spec/javascript-spec.coffee b/spec/javascript-spec.coffee index a7d27a70..6edfde8f 100644 --- a/spec/javascript-spec.coffee +++ b/spec/javascript-spec.coffee @@ -1554,6 +1554,11 @@ describe "Javascript grammar", -> expect(tokens[6]).toEqual value: 'variable', 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 {number=} variable this is the description */') + expect(tokens[4]).toEqual value: '{number=}', scopes: ['source.js', 'comment.block.documentation.js', 'other.meta.jsdoc', 'entity.name.type.instance.jsdoc'] + expect(tokens[6]).toEqual value: 'variable', 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']