Skip to content

Highlight @example jsdoc body as source code #693

@mjbvz

Description

@mjbvz

TS and JS Grammar Extension version: 0.0.47 / latest

Code
For a js doc body such as:

/**
 * @example
 * 1 + 1
 */
const a = 1

We mark the body of the @example block specially but do not actually syntax highlight it. I added an injection grammar in VS Code that does this: https://github.com/Microsoft/vscode/blob/master/extensions/typescript-basics/syntaxes/ExampleJsDoc.injection.tmLanguage.json

May be worth including in the core grammar. Let me know if you agree. The injection grammar will not work as is, we're relying on another injection grammar that handles separating the leading stars of the doc block from the documentation content itself

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions