zed icon indicating copy to clipboard operation
zed copied to clipboard

Add JSDoc syntax highlighting support

Open rpfaeffle opened this issue 1 year ago • 5 comments
trafficstars

SCR-20240215-mokn

Closes #4926

Release Notes:

  • Added support for JSDoc syntax highlighting (#7224).

rpfaeffle avatar Feb 15 '24 13:02 rpfaeffle

Wow, Thank you

And, can you impl the regex match: https://github.com/tree-sitter/tree-sitter-javascript/blob/master/queries/injections.scm#L15-L18

d1y avatar Feb 15 '24 16:02 d1y

I could definitely implement that. But I would create another PR for this feature, because I think those are two different features, especially since the syntax highlighting for regex could be beneficial for multiple languages and not only JS and TS.

rpfaeffle avatar Feb 15 '24 16:02 rpfaeffle

I could definitely implement that. But I would create another PR for this feature, because I think those are two different features, especially since the syntax highlighting for regex could be beneficial for multiple languages and not only JS and TS.

Yep. I'm in favor of implementing it in other PRs. and I think maybe could also help (also in another PR) to implement comment highlighting: https://github.com/zed-industries/extensions/issues/523

I think this tree-sitter-comment is at least the so-called global enablement regardless of any language

image

tree-sitter: https://github.com/stsewd/tree-sitter-comment

Two different scm to reference:

  • helix-editor: https://github.com/helix-editor/helix/blob/59369d99e2ed891206bd63c9b83b034da474920a/runtime/queries/comment/highlights.scm
  • neovim: https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/comment/highlights.scm

Thank you~

d1y avatar Feb 15 '24 17:02 d1y

@SomeoneToIgnore @maxbrunsfeld @JosephTLyons

If there is an interest in implementing something like that with the use of tree-sitter, I would be happy to help.

rpfaeffle avatar Feb 15 '24 21:02 rpfaeffle

Are there any issues with this PR now? Can it be merged now?

d1y avatar Mar 05 '24 05:03 d1y

@rpfaeffle similar to the other one, it seems worth merging this as it improves javascript (which I think will remain "in-core" for a while). Would you mind rebasing on main when you get some time?

ConradIrwin avatar Mar 15 '24 03:03 ConradIrwin

@ConradIrwin I did a rebase of the PR. Should be good to merge.

rpfaeffle avatar Mar 15 '24 16:03 rpfaeffle

Thanks!

ConradIrwin avatar Mar 15 '24 21:03 ConradIrwin