emacs-tree-sitter / elisp-tree-sitter

Emacs Lisp bindings for tree-sitter
https://emacs-tree-sitter.github.io
MIT License
816 stars 73 forks source link

How to use JSDoc syntax with JS/TS #210

Closed trev-dev closed 2 years ago

trev-dev commented 2 years ago

I apologize for my ignorance in advance. I'm not up-to-snuff on how tree-sitter works and am struggling a bit with my Googling/reading to find a solution.

I can't seem to get JSDoc highlighting with tree-sitter in Emacs. The debugger just says the whole block is a comment:. I have tree-sitter-languages installed. I tried adding jsdoc to typescript mode in the languages alist and it broke tree-sitter for TS entirely.

I'm sure this might be some sort of configuration problem. Any insight would be appreciated.

ubolonton commented 2 years ago

elisp-tree-sitter doesn't support multi-language buffers at the moment, so JSDoc fragments inside JS/TS are not recognized, since it's a separate jsdoc grammar.