Stream: wit-bindgen

Topic: Syntax Highlighter for WIT


view this post on Zulip Mossaka (Joe) (Mar 27 2023 at 17:07):

Hi all, I've started working on a syntax highliter for *.wit using TextMate suggested by VSCode and a VSCode extension. My goal is to publish it so that we get proper syntax highligher rendering in multiple text editors, including vim, emacs, vscode, and GH markdown. Bonus point for getting Github code review rendering working.

I am a newbie on writing something like this and it will take some time. I would greatly appreciate if people can confirm that we don't have other people working on the same thing right now! :pray:

Stay tuned and will update on this stream when it's availble to try out!

view this post on Zulip Peter Huene (Mar 27 2023 at 17:47):

Awesome, thanks Mossaka! Happy to help test when you're ready.

view this post on Zulip Lann Martin (Mar 27 2023 at 18:49):

I wrote this long ago if it's at all helpful reference: https://github.com/lann/vscode-wit/

Contribute to lann/vscode-wit development by creating an account on GitHub.

view this post on Zulip Mossaka (Joe) (Mar 27 2023 at 18:55):

Oh nice! I will take a look later

view this post on Zulip Eduardo Rodrigues (Mar 28 2023 at 21:58):

I also have something I was working on that I think is in a pretty good state instead of having to start from scratch. @Mossaka (Joe) , I think we should ask for a repo in the bytecode alliance GitHub organization to concentrate the effort in one place, right?

view this post on Zulip Mossaka (Joe) (Mar 28 2023 at 22:02):

Agreed! That's great.

FYI @Bailey Hayes we probably need a repo in the BCA organization to put this effort in one place.

view this post on Zulip Bailey Hayes (Mar 29 2023 at 08:01):

Nice! What should it be called?

view this post on Zulip Eduardo Rodrigues (Mar 29 2023 at 08:37):

i think we should call it wit-idl

view this post on Zulip Eduardo Rodrigues (Mar 29 2023 at 14:59):

In the meantime, here is a sneak peek of the vscode extension: wit-idl-0.0.1.vsix

view this post on Zulip Mossaka (Joe) (Mar 31 2023 at 05:46):

Eduardo Rodrigues said:

In the meantime, here is a sneak peek of the vscode extension: wit-idl-0.0.1.vsix

Just tried this. This is awesome and it looks like it covers the most up-to-date syntax of WIT! Great work @Eduardo Rodrigues It seems like I don't need to finish my syntax highlighter anymore

view this post on Zulip Mossaka (Joe) (Mar 31 2023 at 05:52):

image.png

I've noticed that the highlighters for import's name and export's name are slightly different. Is that intentional?

view this post on Zulip Mossaka (Joe) (Mar 31 2023 at 05:55):

It seems like the union type has made it not work for interfaces and worlds that are defined after the first interface image.png

view this post on Zulip Eduardo Rodrigues (Mar 31 2023 at 07:27):

The import and export are different on purpose because they are following the same convention as set in the typescript grammar

view this post on Zulip Eduardo Rodrigues (Mar 31 2023 at 07:28):

For the second one, it is definitely a bug

view this post on Zulip Mossaka (Joe) (Mar 31 2023 at 21:51):

I can help to fix it if you have the source code published somewhere

view this post on Zulip Eduardo Rodrigues (Mar 31 2023 at 22:24):

the bug has been fixed now i believe. there you go: https://github.com/eduardomourar/wit-idl

Contribute to eduardomourar/wit-idl development by creating an account on GitHub.

view this post on Zulip Eduardo Rodrigues (Apr 05 2023 at 22:56):

A few improvements have been made to the VSCode extension and a new version has been released: https://github.com/eduardomourar/wit-idl/releases/download/wit-idl-v0.0.6/wit-idl-v0.0.6.vsix

view this post on Zulip Ralph (Apr 10 2023 at 14:16):

@Djordje Lukic I think you have one, too, right? Have a look at @Eduardo Rodrigues's version -- let's see if we can bring people together!

view this post on Zulip Eduardo Rodrigues (Apr 14 2023 at 17:51):

We have a public repository for the WIT extension here: https://github.com/bytecodealliance/vscode-wit and we are working to get that published to the Visual Studio Marketplace.

This package is a Visual Studio Code extension to recognize and highlight the WebAssembly Interface Type (WIT) Interface Definition Language (IDL). - GitHub - bytecodealliance/vscode-wit: This pack...

view this post on Zulip Ralph (Apr 14 2023 at 18:11):

already using it, already happy. Hey, are you thinking of adding tooltips to structures, to help people to learn what values represent?

view this post on Zulip Eduardo Rodrigues (Apr 14 2023 at 18:37):

Not in the short-term because that requires a language server and AFAIK we don’t have one for WIT at this moment.

view this post on Zulip Ralph (Apr 14 2023 at 18:47):

we'd better get on that, methinks. :-)

view this post on Zulip Eduardo Rodrigues (Jun 23 2023 at 19:25):

We finally have syntax highlighting for WIT available in github: https://github.com/bytecodealliance/vscode-wit/issues/7#issuecomment-1604764911

In order to have syntax highlighting available in GitHub (both in markdown and in the file editor associated to .wit extension), we need to add the textmate file located in this repo to the grammar...

Last updated: Dec 23 2024 at 12:05 UTC