aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorDavido264 <67966122+Davido264@users.noreply.github.com>2023-08-28 00:51:30 -0500
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2023-10-01 14:48:22 +0200
commit9510147ee12f92c2e39c6ac78393983cbeee4b81 (patch)
tree2a041bfdf65ccec78cfb3f8ff17713012ffd1552 /lua
parentdocs: update server_configurations.md (diff)
downloadnvim-lspconfig-9510147ee12f92c2e39c6ac78393983cbeee4b81.tar
nvim-lspconfig-9510147ee12f92c2e39c6ac78393983cbeee4b81.tar.gz
nvim-lspconfig-9510147ee12f92c2e39c6ac78393983cbeee4b81.tar.bz2
nvim-lspconfig-9510147ee12f92c2e39c6ac78393983cbeee4b81.tar.lz
nvim-lspconfig-9510147ee12f92c2e39c6ac78393983cbeee4b81.tar.xz
nvim-lspconfig-9510147ee12f92c2e39c6ac78393983cbeee4b81.tar.zst
nvim-lspconfig-9510147ee12f92c2e39c6ac78393983cbeee4b81.zip
feat: add spyglassmc language server support
Spyglass is a language server for minecraft datapacks
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/server_configurations/spyglassmc_language_server.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/lua/lspconfig/server_configurations/spyglassmc_language_server.lua b/lua/lspconfig/server_configurations/spyglassmc_language_server.lua
new file mode 100644
index 00000000..897ada2f
--- /dev/null
+++ b/lua/lspconfig/server_configurations/spyglassmc_language_server.lua
@@ -0,0 +1,29 @@
+local util = require 'lspconfig.util'
+
+return {
+ default_config = {
+ cmd = { 'spyglassmc-language-server', '--stdio' },
+ filetypes = { 'mcfunction' },
+ root_dir = util.root_pattern 'pack.mcmeta',
+ single_file_support = true,
+ },
+ docs = {
+ description = [[
+https://github.com/SpyglassMC/Spyglass/tree/main/packages/language-serve
+
+Language server for Minecraft datapacks.
+
+`spyglassmc-language-server` can be installed via `npm`:
+
+```sh
+npm i -g @spyglassmc/language-server
+```
+
+You may also need to configure the filetype:
+
+`autocmd BufNewFile,BufRead *.mcfunction set filetype=mcfunction`
+
+This is automatically done by [CrystalAlpha358/vim-mcfunction](https://github.com/CrystalAlpha358/vim-mcfunction), which also provide syntax highlight.
+]],
+ },
+}