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

python match case not highlighted #3604

Open
1 task done
A-Walrus opened this issue Mar 10, 2024 · 4 comments
Open
1 task done

python match case not highlighted #3604

A-Walrus opened this issue Mar 10, 2024 · 4 comments
Labels
bug Something isn't working text Text layout, shaping, internationalization, etc. upstream Issues in dependencies.

Comments

@A-Walrus
Copy link
Contributor

Description

Python match and case keywords aren't highlighted.

image

Reproduction URL

https://typst.app/project/rvUJmuGPYUTVAyQavzkUEb

Operating system

Web app, Linux

Typst version

  • I am using the latest version of Typst
@A-Walrus A-Walrus added the bug Something isn't working label Mar 10, 2024
@A-Walrus
Copy link
Contributor Author

Looking into it I understand this is probably upstream, but not sure where. I understand we take the syntaxes from bat, and they in turn take some of them from sublime?

Sublime text (looks correct):
image

Bat (incorrect):
image

@LaurenzV
Copy link
Sponsor Collaborator

Yeah, as far as I know some of the Sublime Syntaxes are pretty outdated...

@laurmaedje laurmaedje added text Text layout, shaping, internationalization, etc. upstream Issues in dependencies. labels Mar 11, 2024
@freundTech
Copy link
Contributor

freundTech commented Mar 12, 2024

Typst uses syntect for syntax highlighting. Typst also uses two-face to provide additional syntaxes for syntect.

pub static RAW_SYNTAXES: Lazy<syntect::parsing::SyntaxSet> =
Lazy::new(two_face::syntax::extra_no_newlines);

two-face = { version = "0.3.0", default-features = false, features = ["syntect-fancy"] }

two-face gets those syntaxes from bat , which maintains the list for use in their own program. two-face includes those syntaxes using a git submodule pointing to a 9 months old version of bat (https://github.com/cosmichorrordev/two-face).

bat in turn gets its syntaxes from Sublime Packages and other sources. It uses a git submodule to include a 4 years old version of Sublime Packages (https://github.com/sharkdp/bat/tree/master/assets/syntaxes)

@freundTech
Copy link
Contributor

Ref: sharkdp/bat#2895

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working text Text layout, shaping, internationalization, etc. upstream Issues in dependencies.
Projects
None yet
Development

No branches or pull requests

4 participants