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

Is there any plan to support typst? #6688

Closed
Qinka opened this issue Apr 10, 2023 · 9 comments · Fixed by #7474
Closed

Is there any plan to support typst? #6688

Qinka opened this issue Apr 10, 2023 · 9 comments · Fixed by #7474
Assignees
Labels
A-language-support Area: Support for programming/text languages C-enhancement Category: Improvements

Comments

@Qinka
Copy link

Qinka commented Apr 10, 2023

Is there any plan to support typst ?

@Qinka Qinka added the C-enhancement Category: Improvements label Apr 10, 2023
@the-mikedavis the-mikedavis added the A-language-support Area: Support for programming/text languages label Apr 10, 2023
@kirawi
Copy link
Member

kirawi commented Apr 10, 2023

typst/typst#118

@KMikeeU
Copy link
Contributor

KMikeeU commented Apr 10, 2023

Looks like typst doesn't have a proper tree-sitter grammar yet, we'll have to wait on that

@kirawi
Copy link
Member

kirawi commented Apr 10, 2023

It does seem to have two:
https://github.com/frozolotl/tree-sitter-typst
https://github.com/SeniorMars/tree-sitter-typst

@ElDifinitivo
Copy link

I've just started testing out typst for personal use, and although it's new, nvarner/typst-lsp seems to work well with language-server = { command = "typst-lsp" } as the config.

@nluetts
Copy link

nluetts commented May 3, 2023

@ElDifinitivo could you share the specific part of your language.toml that configures typist? I cannot get it to work, the LSP wont start, though it is on path. My naive try:

[[language]]
name = "typst"
injection-regex = "typ"
language-server = { command = "typst-lsp"}
file-types = ["typ"]
roots = []

@kirawi kirawi self-assigned this May 3, 2023
@ElDifinitivo
Copy link

could you share the specific part of your language.toml that configures typist? I cannot get it to work, the LSP wont start, though it is on path.

@nluetts here's what I have:

[[language]]
name = "typst"
scope = "source.typst"
injection-regex = "typst"
roots = []
comment-token = "//"
file-types = ["typ"]
indent = { tab-width = 2, unit = " " }
language-server = { command = "typst-lsp" }
text-width = 100
rulers = [100]
soft-wrap.wrap-at-text-width = true

I've also tried the two grammars posted above. I can't get SeniorMars' to work, but frozolotl's does although it's very limited at the moment.

[[grammar]]
name = "typst"
source = { path = "/path/to/git-clone/tree-sitter-typst" }

@ejuarezg
Copy link

ejuarezg commented Jun 8, 2023

Has anyone managed to get @ElDifinitivo config to work on v23.05? It doesn't seem to work for me.

Edit: Nevermind, it does work. I thought it wasn't working due to the lack of syntax highlighting.

@uben0
Copy link

uben0 commented Sep 9, 2023

I wrote and I maintain a grammar: https://github.com/uben0/tree-sitter-typst
If this is of any interest.

@the-mikedavis
Copy link
Member

There's a PR open that uses the SeniorMars grammar #7474 but if yours is more complete, feel free to open a PR that adds typst based on your grammar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-support Area: Support for programming/text languages C-enhancement Category: Improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants