Usage
To Use the Data Pack Language Server
The Data Pack Language Server can provide language features like code completions and refactors for making Minecraft: Java Edition data packs. It can be installed to any text editors that support the LSP. We only provide instructions for several typical editors here. Please join the discuss space if you need any help.
For Visual Studio Code
Visual Studio Code is the primarily supported text editor by the SPYGlass development team. You just need to install the VS Code extension to enjoy all the features provided by the Language Server.
For Sublime Text 3
The process of setting up the Language Server for Sublime Text is quite tedious. We will look into improving it in the future.
- Install Node.js if you haven’t.
- Execute
npm i -g @spgoding/datapack-language-server
in your command line to install the Language Server. - Install Package Control if you haven’t.
- Install Arcensoth’s language-mcfunction package by following the instructions if you haven’t.
- Install LSP package.
- Open the Command Palette and select
Preferences: LSP Settings
. - Configure LSP to add the Language Server. Here’s one example:
{ "clients": { "datapack-language-server": { "command": [ "datapack-language-server", "--stdio" ], "enabled": true, "languages": [ { "languageId": "mcfunction", "scopes": [ "source.mcfunction" ], "syntaxes": [ "Packages/language-mcfunction/mcfunction.tmLanguage" ] }, { "languageId": "json", "scopes": [ "source.json" ], "syntaxes": [ "Packages/JavaScript/JSON.sublime-syntax" ] } ] } }, "only_show_lsp_completions": true }
- Open the Command Palette, select
LSP: Enable Language Server Globally
, and choosedatapack-language-server
. - Enjoy. Do note that you need to execute the command in step 2 manually if you want to update the Language Server.