Jump to content

Recommended Posts

Posted

Hi all,

I recently released an alpha version of NWScript Workbench, a new VS Code extension for working with NWScript.

The goal is to provide a more complete NWScript development environment directly inside VS Code. You can write .nss files with syntax highlighting and IntelliSense, navigate includes and symbols using normal VS Code features like Go to Definition and Find References, and compile directly to .ncs without needing a local copy of nwnnsscomp.exe.

ss-script-editor-with-intellisense.png

The compiler side of this is handled by a separate project, nwscript-wasm. I ported the public NWScript compiler released by Beamdog on GitHub to WebAssembly, which allows the compiler to execute directly inside the VS Code extension host rather than shelling out to a native executable.

That makes the compiler portable and OS agnostic, but it also means the extension works in VS Code for the Web. You can open vscode.dev, install NWScript Workbench, open a workspace, and write and compile NWScript entirely from the browser.

There is no native compiler installation required at runtime.

 

The extension currently includes things like:

  • NWScript syntax highlighting and engine-aware IntelliSense

  • signature help and API documentation pulled from the active nwscript.nss

  • Go to Definition, Find References, and include navigation

  • .nss.ncs compilation through WebAssembly

  • compiler diagnostics directly in the editor

  • recursive #include resolution

  • compile-on-save and configurable optimization levels

  • support for custom and project-specific nwscript.nss language specifications

  • NCS hex viewing and side-by-side disassembly

  • a Script Browser for searching the decompiled KOTOR and TSL script sources maintained by the KOTOR Community Patches project

  • support for desktop VS Code, vscode.dev, github.dev, Codespaces, and other compatible web extension hosts

ss-script-browser.png

ss-script-dissasembler-with-hex-and-asm-views.png

I intentionally kept the WASM compiler and VS Code extension as separate projects. The compiler isn't tied to VS Code and can be used by other JavaScript or TypeScript projects that need to compile NWScript.

This is still an alpha, so there is plenty left to improve, but it has gotten to the point where I wanted to start getting it into people's hands and getting feedback from people who actually work with NWScript.

NWScript Workbench is available through the Microsoft VS Code Marketplace:

https://marketplace.visualstudio.com/items?itemName=KobaltBlu.nwscript-workbench

You can also build and install the VSIX yourself from the source.

NWScript Workbench Extension:
https://github.com/KobaltBlu/nwscript-workbench-vscode-ext

NWScript WASM Compiler:
https://github.com/KobaltBlu/nwscript-wasm

If you try it out and run into problems, or there are features you would like to see added, feel free to open an issue on GitHub.

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines.