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 folder. 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 monaco 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 bin/server.js relative to the build.hxml. You might want to move it to client/haxe/server.js.
Using the npm @yao-pkg/pkg library you can pack the compiled server.js into a binary for Windows, Linux or Mac.
First you must install the library globally
npm install -g @yao-pkg/pkgThen you may bundle it for the following targets:
pkg client/haxe/server.js --targets node18-win-x64 --output bin/haxe-language-serverpkg client/haxe/server.js --targets node18-linux-x64 --output bin/haxe-language-serverpkg client/haxe/server.js --targets node18-macos-x64 --output bin/haxe-language-serverThe 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 client/haxe/server.js.
It's just a haxe C++ app so just make sure you have haxe, hxcpp and the target's required build tools (like msvc/mingw for windows or clang/gcc for linux or sumth idk)
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