typst icon indicating copy to clipboard operation
typst copied to clipboard

VSCode Language Highlight?

Open yolonir opened this issue 2 years ago • 8 comments

Hey Typst team, amazing project, love it! I wonder how can I use language highlighting presented in your tutorials in other editors? VSCode in this example

yolonir avatar Mar 22 '23 17:03 yolonir

Currently, there are two pathways for this.

Provided tools

See https://github.com/typst/typst/tree/main/tools/support i.e. the tools/support folder in the repo. To use this, you need to use Command palette and click this. image Then navigate to the folder and select the tools/support folder.

This should yield a Typst extension (almost silently) and it looks like this: image

You can find it under installed extensions.

This is what it does:

image

The second way will have to be in another post..

CGMossa avatar Mar 22 '23 21:03 CGMossa

Another way, a community member has already started the churn and the overwhelmingly sought after work of providing an LSP for typst (plus vscode plugin), by mining typst-repo, and more. See here for it https://github.com/nvarner/typst-lsp

@nvarner I wish you good luck with it!

CGMossa avatar Mar 22 '23 21:03 CGMossa

This should yield a Typst extension (almost silently) and it looks like this: image

Tried both in VSCodium and VSCode but nothing happens. no extension shows up.

osequi avatar Mar 23 '23 07:03 osequi

This should yield a Typst extension (almost silently) and it looks like this: image

Tried both in VSCodium and VSCode but nothing happens. no extension shows up.

Just to make sure you understand, this isn't a published extension. It appears when you install from a folder locally on your machine.

There were no other steps and nothing else I've done to make it appear. So I cannot help you further with this unfortunately.

CGMossa avatar Mar 23 '23 08:03 CGMossa

Ok, it works, the docs (https://github.com/typst/typst/issues/163#issuecomment-1480257515) were a bit unclear.

After the step: "Then navigate to the folder and select the tools/support folder." nothing will happen, the extension will be silently installed, and the extension description tab won't pop-up, as the doc suggested to me.

Thanks :D

osequi avatar Mar 23 '23 08:03 osequi

Would it make sense to add these instructions to the official docs? I think the existence of this barebones VSCode plugin is a great argument to increase adoption

gdalle avatar Mar 24 '23 16:03 gdalle

Someone is making a real plug in. I'd like to give them a chance to put it together and then make that the official recommendation.

CGMossa avatar Mar 24 '23 16:03 CGMossa

Nice! Thank you!

yolonir avatar Mar 24 '23 17:03 yolonir

Please note that I'm in no way part of the team. I'm just giving my community member review. It helps other projects, but I could be both factually wrong, and my opinions may be opposite of the typst team.

CGMossa avatar Mar 24 '23 21:03 CGMossa

With that said, I urge everyone that are interested, or may help out, to this https://github.com/nvarner/typst-lsp/discussions/15

CGMossa avatar Mar 24 '23 22:03 CGMossa

@CGMossa nicely outlined the two available alternatives. I'll close this as completed for now.

reknih avatar Apr 04 '23 18:04 reknih