Skip to content

JSDoc highlighting fails on multiline type definition #726

Closed
@Seblor

Description

@Seblor
  • VSCode Version: 1.31.1
  • OS Version: Windows 10

When creating a JSDoc type definition (with either @type or @typedef), the syntax highlighting fails at the first new line :

Steps to Reproduce:

Create JS file, write this code :

/**
 * @typedef {{
 *   mode: "manual" | "auto",
 *   foo: String
 * }} someType
 */

/**
 * @type {{
 *   state: someType
 *   someProp: {
 *     foobar: Number
 *   }
 * }}
 */
const store = {
	"state": {
		"mode": "auto"
	}
};

The JSDoc syntax highlighting shows the {{ in the first line in red with the rest of the comment in the usual dark green comment color, however, the JSDoc has been successfully parsed :

Hovering the store variable :

Preview 1

Switch/case intellisense :

Preview 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions