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

Feature Request: Typst Support #570

Open
farinc opened this issue Feb 25, 2024 · 2 comments
Open

Feature Request: Typst Support #570

farinc opened this issue Feb 25, 2024 · 2 comments

Comments

@farinc
Copy link

farinc commented Feb 25, 2024

I think the addition of Typst support would be great, it being a sort of successor to LaTex with already great support in VS Code. It is also very similar to Markdown.

@memeplex
Copy link

memeplex commented Mar 3, 2024

I was going to ask the same.

I think the only thing to do is to support the "text" class in parserByClass:

image

@memeplex
Copy link

memeplex commented Mar 3, 2024

No, I assumed you were using vscode syntax classes, but I see there are custom parsers for each supported value.

Isn't there more performant filters based on syntax scopes so as not to use regexs nor implement yet another parser by hand?

In Typst you have arbitrarily nested code and content blocks. A code block is introduced by #{...}, but there are also some shortcuts like #func(...) or #var or #show: ... (known as show-rules). Notice that special characters like # can be escaped as in \#. Comments are C-style, both // and /* ... */. Since the top-level is content, it's probably convenient to match code and comments and treat everything else as the body.

Anyway, I think that a better strategy could be to depend on the Textmate scope, but that may vary with the provider. Currently vanilla VSCode has some support for Typst syntax, but the typst-lsp extension adds additional rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants