tree-sitter / tree-sitter-rust

Rust grammar for tree-sitter
MIT License
340 stars 97 forks source link

Separate regular comments from Doc Strings #147

Closed nickeb96 closed 6 months ago

nickeb96 commented 2 years ago

It would be great if documentation comments made with ///, //!, etc. were matched to different nodes than normal comments. I'd like to be able treat them separately when doing syntax highlighting.

nickeb96 commented 2 years ago

Bump

Is this project still being maintained?

aryx commented 2 years ago

it's maintained, but there's not much activity.

aryx commented 2 years ago

We accept PRs to fix issues though :)

maxcountryman commented 1 year ago

In a similar vein, I'd like to be able to syntax highlight examples in doc strings. This is a feature of other highlighters. Is such a thing possible with tree-sitter?

cormacrelf commented 1 year ago

See #128 which merges successive doc comments, which it seems would be a precondition to adding rust embeds for fenced code blocks in documentation.

Chris00 commented 9 months ago

This distinction will be done in Emacs. See also the duplicate issue https://github.com/tree-sitter/tree-sitter-rust/issues/175.