tree-sitter-rust
tree-sitter-rust copied to clipboard
Expose doc comment contents
#195 parsed doc comments but it exposed the nodes for the doc comment markers (!//) rather than the content of the comments. The comment content is useful for injecting markdown into the comments:
; injections.scm
([(line_comment !doc) (block_comment !doc)] @injection.content
(#set! injection.language "comment"))
((doc_comment) @injection.content
(#set! injection.language "markdown")
(#set! injection.combined))
I've also changed the line doc comment slightly to fix an issue with the marker node (it unnecessarily consumed the character after the ///) and to include the line's line-ending, which is useful to tree-sitter-markdown.
~cc @ProfDoof I've only made the change to line comments, I may need some help to make block comments have the same structure~
Block comment changes are included as well.
removed package brightnessctl from here to be added into the package file, as your requested changes
still this should be added as an commented option.
have raised pull request in the package section
The question about why it should be added and if the current implementation is causing any issue is still open.
I would have no issue to add the option commented, with the info that it is alternative to the one that is set-up already.. and indeed that you will need to install the package to use the option. I will not change a working implementation and add packages to the list of the install process without any reason.