An implementation of the Monaco Editor (using monaco-vscode-api) into a webview with functionality for the Haxe Language Server and local workspaces.
The editor is written in JS because that's what Monaco Editor uses. It's source can be found in the client subbmodule. It uses Vite Build so you need to have npm installed to build it. You can also use bun if you're a freaky enough with JS shtuff
cd client
npm install
npm run buildOr with bun (you freak)
cd client
bun install
bun run buildThe output will automatically overwrite the compiled source in the shadowcode folder which is embedded into the compiled haxe binary and loaded through the webview.
Haxe Language Server is written in Haxe (wow) then compiled to nodejs. We also bundle it into a binary to avoid requiring nodejs as a dependency when running a release build.
I have no fucking clue how to build that shit it always gave me errors so I just copied the language server from the vscode extension 🙏
But generally it should be like this:
First clone the repository
git clone https://github.com/vshaxe/haxe-language-server
cd haxe-language-serverThen create a newrepo inside of it so the libraries aren't downloaded globally but inside of a local .haxelib folder using:
haxelib newrepoThen install the libraries using the state file:
haxelib state load install.hxmlThen finally run the build
haxe build.hxmlIf it compiled for you then congrats the output should supposedly be in haxe-language-server/bin/server.js relative to the build.hxml. You might want to move it to language-servers/haxe/server.js on the ShadowCode source.
We prebuild the compiled server.js into x64_86 and arm64 binaries using the npm @yao-pkg/pkg for Windows, Linux and Mac.
If you want to update the language server or build for armv7 then follow the build instructions below.
First you must install the pkg library globally
npm install -g @yao-pkg/pkgThen you may bundle it for the following targets:
pkg language-servers/haxe/server.js --targets node22-win-x64 --output bin/win/haxe-language-server-x64
pkg language-servers/haxe/server.js --targets node22-win-arm64 --output bin/win/haxe-language-server-arm64pkg language-servers/haxe/server.js --targets node22-linuxstatic-x64 --output bin/linux/haxe-language-server-x64
pkg language-servers/haxe/server.js --targets node22-linuxstatic-arm64 --output bin/linux/haxe-language-server-arm64
pkg language-servers/haxe/server.js --targets node22-linuxstatic-armv7 --output bin/linux/haxe-language-server-armv7pkg language-servers/haxe/server.js --targets node22-macos-x64 --output bin/mac/haxe-language-server-x64
pkg language-servers/haxe/server.js --targets node22-macos-arm64 --output bin/mac/haxe-language-server-arm64The output MUST be on the bin folder so the haxe macro can pick it up when building the app. you may compile the server from a different source path but we drop it inside of language-servers/haxe/server.js.
It's just a haxe C++ app so just make sure you have haxe, hxcpp and the target's required compiling stuff
You need to install hxwebview through
haxelib install hxwebviewThen just run the build commad:
haxe build-win.hxmlThe exe will be found in ./export/win/Main.exe alongside it the required binaries are WebView2Loader.dll and bin/haxe-language-server.exe
TBD
TBD