tree-sitter / tree-sitter-typescript

TypeScript grammar for tree-sitter
MIT License
342 stars 104 forks source link

TSX Todo and JSDOC Params not highlighted #157

Closed danielnehrig closed 3 years ago

danielnehrig commented 3 years ago

On a TSX file the JSDOC params are not highlighted

example:

/**
 * TODO im not highlighted
 * @see im also not highlighted
 * @param not highlighted :(
 */
const Component = () => {
 return <>broken</>
}
mjambon commented 3 years ago

Comments are not parsed at the moment, which is why there's no highlighting in your editor. The typescript and tsx grammars extend the javascript grammar and would inherit how comments are parsed.

I'm not going to implement it myself because I'm here for features that benefit semgrep, but if you or someone else want to add it, PRs are welcome.

maxbrunsfeld commented 3 years ago

@danielnehrig Are you referring to a behavior in Neovim? I think yo should open a Neovim issue. There is this parser that Neovim can use to parse doc comments: https://github.com/tree-sitter/tree-sitter-jsdoc.