stsewd / tree-sitter-comment

Tree-sitter grammar for comment tags like TODO, FIXME(user).
https://stsewd.dev/tree-sitter-comment/
MIT License
134 stars 9 forks source link

Add support for parsing URLs. #20

Closed dsully closed 1 year ago

dsully commented 1 year ago

This fixes #15, using the URL parsing code from your tree-sitter-rst repository: https://github.com/stsewd/tree-sitter-rst/blob/master/src/tree_sitter_rst/parser.c#L1312

In Neovim, I can now add:

; extends

(url) @text.uri

In a after/queries/comment/highlights.scm file. This should be integrated into nvim-treesitter itself after merging.

dsully commented 1 year ago

Ping

stsewd commented 1 year ago

Hi, thanks for the PR. I'll try to give it a review this weekend.

dsully commented 1 year ago

Great, thank you!

stsewd commented 1 year ago

Hi again, sorry I won't be able to merge this PR, but I was able to add support for URIs in https://github.com/stsewd/tree-sitter-comment/pull/21 without the need of more C code.

Other differences:

Thanks again for opening this PR, sorry I wasn't able to re-use it.

dsully commented 1 year ago

No problem - the feature is really is, no matter how we get there. I must have typo'd url instead of uri.

Will you be making a PR on nvim-treesitter to pull this in?

I assume comment/highlights.scm will need to be updated there as well?

Thanks!

stsewd commented 1 year ago

Will you be making a PR on nvim-treesitter to pull this in?

Yeah, doing that now :)