Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add tree-sitter-comment #1300

Merged
merged 11 commits into from
Dec 19, 2021
Merged

Conversation

the-mikedavis
Copy link
Member

closes #1164
builds on #1170

@sudormrfbin
Copy link
Member

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

@the-mikedavis
Copy link
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
Copy link
Member

sudormrfbin commented Dec 19, 2021

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

@pickfire
Copy link
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
Member

Thanks! 🎉

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

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
Copy link
Contributor

pickfire commented Dec 20, 2021

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

@archseer
Copy link
Member

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

@bestouff
Copy link

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