Skip to content

add tree-sitter-comment - #1300

Merged
archseer merged 11 commits into
helix-editor:masterfrom
the-mikedavis:md-comment
Dec 19, 2021
Merged

add tree-sitter-comment#1300
archseer merged 11 commits into
helix-editor:masterfrom
the-mikedavis:md-comment

Conversation

@the-mikedavis

Copy link
Copy Markdown
Member

closes #1164
builds on #1170

@sudormrfbin

Copy link
Copy Markdown
Member

Is there any way to inject this without manually specifying it in the corresponding injections.scm for every language ?

@the-mikedavis

Copy link
Copy Markdown
Member Author

I think you have to do it manually for all :/

We could try enabling a 'hidden' injections.scm like

((comment) @injection.content
 (#set! injection.language "comment"))

but that might break or not work on languages that have different names for comment nodes (like languages that have different block and line comments)

@sudormrfbin

sudormrfbin commented Dec 19, 2021

Copy link
Copy Markdown
Member

Seems like nvim-treesitter also manually specifies it for every single language :/

@pickfire

Copy link
Copy Markdown
Contributor

Oh, I thought modification to the code base is required.

@archseer
archseer merged commit e72786d into helix-editor:master Dec 19, 2021
@archseer

Copy link
Copy Markdown
Member

Thanks! 🎉

@the-mikedavis
the-mikedavis deleted the md-comment branch December 19, 2021 16:34
@bestouff

Copy link
Copy Markdown

Hi,
I just updated hx and tried to edit a rust file with a // TODO comment but it's not highlighted. Is there something I need to do ?

@pickfire

pickfire commented Dec 20, 2021

Copy link
Copy Markdown
Contributor

@bestouff Which language did you use? The TODO support needs to be added to the language highlights.

@archseer

Copy link
Copy Markdown
Member

Make sure you cargo clean and rm runtime/grammars/* to ensure the new grammars are built.

@bestouff

Copy link
Copy Markdown

Make sure you cargo clean and rm runtime/grammars/* to ensure the new grammars are built.

That was it. Thanks to all of you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

highlight TODO, FIXME and XXX in comments

5 participants