Minecraft Function LSP for better development experience
Note
This project is still in-development. This section will appear later.
If your editor isn't listed here, refer to the editor's documentation regarding installation of custom LSP servers.
You will need to define mcfunction filetype:
vim.filetype.add {
extension = {
mcfunction = 'mcfunction',
},
}Then register the LSP:
local client = vim.lsp.start_client {
name = 'mcfunction_lsp',
cmd = { '/path/to/mcfunction-lsp' },
root_dir = vim.fn.getcwd(),
}
if not client then
vim.notify 'MCFunction LSP Client did not load!'
end
-- Attach the LSP client when opening an .mcfunction file
vim.api.nvim_create_autocmd('FileType', {
pattern = 'mcfunction',
callback = function()
vim.lsp.buf_attach_client(0, client)
end,
})Install the VSCode Extension.
- Clone the repository:
git clone https://github.com/mend-lang/mcfunction-lsp.git. - Compile the project:
2.1. Use
make devto compile a debug build. 2.2. Usemake prodto compile to every platform (Windows, MacOS, Linux) - Provide the path to binary in your editor's LSP config.