Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for JSDoc multiline syntax highlighting #19575

Closed
1 task done
BenasMot opened this issue Oct 22, 2024 · 1 comment
Closed
1 task done

Support for JSDoc multiline syntax highlighting #19575

BenasMot opened this issue Oct 22, 2024 · 1 comment
Labels
enhancement [core label] javascript JavaScript programming language support language An umbrella label for all programming languages syntax behaviors tree-sitter Syntax highlighting and tree-sitter upstream

Comments

@BenasMot
Copy link

Check for existing issues

  • Completed

Describe the feature

The editor does not apply correct syntax highlighting for multiline JSDoc definitions.

Current implementation marks all text of a JSDoc definition after a line break as a regular comment. It should be highlighted just like it is when written in a single line.

If applicable, add mockups / screenshots to help present your vision of the feature

Current behaviour Expected behaviour
image image
@BenasMot BenasMot added admin read Pending admin review enhancement [core label] triage Maintainer needs to classify the issue labels Oct 22, 2024
@JosephTLyons JosephTLyons added javascript JavaScript programming language support language An umbrella label for all programming languages syntax behaviors tree-sitter Syntax highlighting and tree-sitter and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Oct 25, 2024
@notpeter
Copy link
Member

Are you sure this is valid jsdoc? (Apologies for my ignorance if so):

/**
* @typedef {{fizz: fizz, buzz: buzz}}
* @typedef {{
* fizz: fizz
* buzz: buzz
}}
*/

VSCode also seems to highlight this incorrectly:

Image

The upstream tree-sitter-jsdoc seems to be puking on the {{ at the end of the line too.

# tree-sitter parse a.jsdoc
(document [0, 0] - [6, 0]
  (tag [1, 2] - [1, 10]
    (tag_name [1, 2] - [1, 10]))
  (ERROR [1, 11] - [4, 2]))
a.jsdoc	   0.04 ms	  1937 bytes/ms	(ERROR [2, 11] - [5, 2])

If this is valid syntax, please file that upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement [core label] javascript JavaScript programming language support language An umbrella label for all programming languages syntax behaviors tree-sitter Syntax highlighting and tree-sitter upstream
Projects
None yet
Development

No branches or pull requests

3 participants