zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
49.69k stars 3.05k forks source link

Blockquotes Styling #10660

Open clseibold opened 6 months ago

clseibold commented 6 months ago

Check for existing issues

Describe the feature

I would like to be able to syntax highlight blockquotes in markup languages, both for themes and language extensions. This requires two things:

If applicable, add mockups / screenshots to help present your vision of the feature

No response

iamnbutler commented 6 months ago

Bringing my comment over from discord:

image

so this more or less just works – there are some extra cases that need to be handled also the treesitter query breaks a bit with nested elements This green > is being captured as a block_quote_marker nested inside of the atx_heading, which is incorrect.

image

iamnbutler commented 6 months ago

If someone wants to dig into all the cases that need to be captured to style block quotes be my guest, otherwise I'll see if I can pick it up tomorrow or when I have some time.

I was just grabbing text from here: https://www.markdownguide.org/basic-syntax/#blockquotes-1

This is the basic query I started:

;; crates/languages/src/markdown/highlights.scm
;; ...

(block_quote
  (block_quote_marker) @punctuation.block_quote_marker
  (paragraph) @text.block_quote
)

;; ...