Open GNRSN opened 8 months ago
I don't think I can do anything here because the parser does not provide any useful information. Let's take this piece of Javascript code:
/**
* A function with delimiters in type comments
*
* @param {{id: string, friends: {id: string}[]}} data
*/
const greet_person = ({id, friends}) => {
return id
}
Here is the syntax tree of the entire comment:
(comment ; [51:1 - 55:3]
(description) ; [52:4 - 46]
(tag ; [54:4 - 54]
(tag_name) ; [54:4 - 9]
"{" ; [54:11 - 11]
(type) ; [54:12 - 48]
"}" ; [54:49 - 49]
(identifier))) ; [54:51 - 54]
As you can see everything inside the {
and }
is one single node, there is no structured information. This plugin relies on Tree-sitter to provide structure information, but I don't have anything to work with here.
Language affected
Javascript
Description
The jsdoc format for javascript supports adding types, including writing typescript inside the comment which can be used by the typescript compiler to typecheck js code. Since rainbow-delimiters works for both js and ts already, it would be awesome if it applied in jsdoc as well.
Example comparison with vscode:
Neovim:
Vscode: