Skip to content

Improve highlight, outline, documentation, and more#64

Merged
MrSubidubi merged 15 commits into
zed-extensions:mainfrom
Gaspartcho:main
May 14, 2026
Merged

Improve highlight, outline, documentation, and more#64
MrSubidubi merged 15 commits into
zed-extensions:mainfrom
Gaspartcho:main

Conversation

@Gaspartcho
Copy link
Copy Markdown
Contributor

@Gaspartcho Gaspartcho commented Mar 28, 2026

Closes #33
This PR introduces a few improvements to this extension

Improved preview

The sections are now nested in the Outline panel

image

Improved highlighting

Made so that the different highlights matched more the ones on the online typst editor.

It would be nice to experiment a bit more with this configuration, and see if any bugs appear.

LSP features: Preview & formatting

Added instructions in the project's README on how to enable formatting.

Added instructions on how to start preview feature in the background (since Zed cannot run LSP commands as of writing, this is the only way to use this feature).

Added a task to open the preview.

@cla-bot cla-bot Bot added the cla-signed label Mar 28, 2026
@Gaspartcho Gaspartcho changed the title Improve highlight, outline, and documentation Improve highlight, outline, and documentation, and more Mar 29, 2026
Comment thread README.md Outdated
project-specific config),

```json
To register the LSP and enable certain features (such as compile on save), add the following your `settings.json` (or `.zed/settings.json` in the project root for project-specific config),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not possible to configure LSP settings in the project setttings, see https://zed.dev/docs/remote-development#zed-settings

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for spotting my mistake. It should be fixed now.

@MrSubidubi MrSubidubi changed the title Improve highlight, outline, and documentation, and more Improve highlight, outline, documentation, and more Apr 17, 2026
Copy link
Copy Markdown
Contributor

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! Have one bigger comment, but overall looks like a good improvement! See https://zed.dev/docs/extensions/languages#fallback-captures on this.

We could probably land these incrementally if you want these in faster, but also happy to just take another look with those captures added.

Comment thread languages/typst/highlights.scm Outdated
Comment on lines +111 to +118
"```" @punctuation.delimiter
"```" @embedded
(blob) @text.literal)

(raw_blck
lang: (ident) @tag)
lang: (ident) @embedded)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for the captures where we fundamentally change the highlights, we should look into adding fallback captures. This applies especially to captures that are not too widespred, like the embedded here

Copy link
Copy Markdown
Contributor Author

@Gaspartcho Gaspartcho May 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I can add the previous capture as fallback, though I don't think it would make a lot of changes, since the embedded capture is one of the captures officially supported by the Zed team.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the capture fallback in the latest commit (0de9652). I put the old captures as fallback.

@Gaspartcho
Copy link
Copy Markdown
Contributor Author

We could probably land these incrementally if you want these in faster, but also happy to just take another look with those captures added.

Hello, regarding the way we integrate these changes inside the repo is entirely up to your preferences. I put everything in one PR because these are changes I made for myself over time and decided to bring them upstream.

Maybe putting everything in one single PR was a bit too much?

@MrSubidubi
Copy link
Copy Markdown
Contributor

To be honest, I think most of this is an easy approve. If we add fallback highlights for the cases where the highlighting changed and people might otherwise end up with no highlights, I'd be happy to just get this in.

Comment thread languages/typst/highlights.scm Outdated
Comment thread languages/typst/highlights.scm Outdated
Comment thread languages/typst/highlights.scm Outdated
Co-authored-by: Finn Evers <finn.evers@outlook.de>
Copy link
Copy Markdown
Contributor

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now, added a few more fallbacks, happy to remove them in the future if we deem them to not be worth it.

Thank you so much for this, awesome contribution!

@MrSubidubi MrSubidubi enabled auto-merge (squash) May 14, 2026 10:52
@MrSubidubi MrSubidubi merged commit 94671e6 into zed-extensions:main May 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add intro of live preview method in readme.md

3 participants