Build - SpyglassMC/Spyglass GitHub Wiki
You can build the VS Code extension
yourself to experience the latest features and bugs without sponsoring.
- Install Node.js
- Clone the Repositories
- Install Node Modules
- Test the Extension without Packaging
- Start the Extension with Packaging
Node.js is the runtime required for building the language server.
You can download it from the official website: https://nodejs.org/en/download. LTS version should be good enough.
You can clone the repositories if you have Git installed:
git clone https://github.com/SPGoding/datapack-language-server.git
git clone https://github.com/SPGoding/vscode-datapack-helper-plus.git
The datapack-language-server repository stores the code of the language server, while vscode-datapack-helper-plus
stores the code of the VS Code extension.
- Go in both repositories and execute npm iindividually, which will install the necessary node modules for the language server and the extension to run.
- Go in your local datapack-language-serverrepository, executenpm run buildandnpm link.
- Switch to your local vscode-datapack-helper-plusrepository, executenpm link @spgoding/datapack-language-server.
You can start the extension in VS Code directly while developing.
- Go in your local datapack-language-serverrepository.
- Run npm run build. The TypeScript code will be compiled to JavaScript. Alternatively you can runnpm run watchwhich keeps compiling the code as long as you make changes to the TypeScript code.
- Switch to your local vscode-datapack-helper-plusrepository.
- Open VS Code there.
- Press F5.
You can also start the extension by packaging it with vsce. You can distribute the packaged extension to others.
vsce, short for "Visual Studio Code Extensions", is a command-line tool for packaging, publishing and managing VS Code extensions. -- VS Code's documentation
You can install vsce by running:
npm install -g vsce
- Go in your local datapack-language-serverrepository.
- Run npm run build. The TypeScript code will be compiled to JavaScript. Alternatively you can runnpm run watchwhich keeps compiling the code as long as you make changes to the TypeScript code.
- Switch to your local vscode-datapack-helper-plusrepository.
- Run npm run build.
- Run vsce package.
After a few minutes, you will get a packaged extension named datapack-language-server-VERSION.vsix
in the root directory. You can now install the vsix
file to play with it.