microsoft / microsoft/monaco-editor

[Bug] Using `@example` on jsdoc breaks code blocks

Open
#3,107 4 comments 4 reactions 1 assignee View on GitHub

@hediet is already working on this.

Since Jul 22, 2022.

bug typescript
Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

Reproducible in vscode.dev or in VS Code Desktop?
  • Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
Monaco Editor Playground Code
monaco.editor.create(document.getElementById('container'), {
	value: `
    /**
     * Something description.
     *
     * \`\`\`js
     * working();
     * // stuff
     * \`\`\`
     * 
     * @example
     * \`\`\`js
     * notWorking();
     * // stuff is inlined?
     * \`\`\`
     */
    function foo(){
    }`,
	language: 'javascript'
});
Actual Behavior

The code blocks are treated as single line code segments, making them unreadable.

Like:

callGetter(); let foo = getGetterGetter(); foo.a = 1; foo.exec()

Expected Behavior

The code blocks to be displayed as blocks, like:

callGetter();
let foo = getGetterGetter();
foo.a = 1;
foo.exec()
Additional Context

Inserting a single @example tag only breaks the code blocks that come after it, leaving the other ones untouched

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.