Pika-Pool / vscode-wasp

Wasp extension for Visual Studio Code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VS Code Wasp language extension

This is a Visual Studio Code language extension for wasp language!

Features

For now, only feature is syntax highlighting of .wasp files.

Development (for contributors)

Resources

Workflow

Grammar is defined in syntaxes/wasp.tmLanguage.yaml, and you do most of the changes there.

VSCode needs .json, not .yaml -> use npm run build to generate .json from .yaml.

package.json is also important -> besides general settings, we also define embedded languages and extension dependencies there.

  1. Open root dir of this project with VSCode.
  2. Run F5 -> this will start another, "testing" window with extension loaded and working.
  3. In "testing" window: open some .wasp file to see how extension works.
  4. Modify extension source with new changes (most likely syntaxes/wasp.tmLanguage.yaml) and run npm run build to regenerate .json.
  5. In "testing" window: run "Reload Window" command to load updated version of extension.
  6. In "testing" window: while inspecting .wasp file to see how extension works, you can run "Developer: Inspect Editor Tokens and Scopes" command to get a popup for each token showing how it got clasified/scoped by extension -> this is great for figuring out if extension does what it should do, which is at the end, applying correct scopes.
  7. Repeat step 4.

Publish

Make sure you have vsce installed: npm -g install vsce.

Next, make sure you are logged in with the publisher. If you are not logged in yet, you can log in with vsce login wasp-lang.

To package the extension into a .vsix file, run vsce package.

To package and then publish the extension, run vsce publish.

About

Wasp extension for Visual Studio Code