diff options
| author | William Boman <william@redwill.se> | 2021-10-17 22:47:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-17 22:47:11 +0200 |
| commit | 5679a8bd21c25c33f4fb971ed09241e327f9fa76 (patch) | |
| tree | fc48ea4ef39e23548a837ca3d64732fda74285ca /lua/nvim-lsp-installer/servers | |
| parent | add powershell_es (#168) (diff) | |
| download | mason-5679a8bd21c25c33f4fb971ed09241e327f9fa76.tar mason-5679a8bd21c25c33f4fb971ed09241e327f9fa76.tar.gz mason-5679a8bd21c25c33f4fb971ed09241e327f9fa76.tar.bz2 mason-5679a8bd21c25c33f4fb971ed09241e327f9fa76.tar.lz mason-5679a8bd21c25c33f4fb971ed09241e327f9fa76.tar.xz mason-5679a8bd21c25c33f4fb971ed09241e327f9fa76.tar.zst mason-5679a8bd21c25c33f4fb971ed09241e327f9fa76.zip | |
add vala_ls (#167)
Diffstat (limited to 'lua/nvim-lsp-installer/servers')
| -rw-r--r-- | lua/nvim-lsp-installer/servers/init.lua | 1 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/servers/vala_ls/init.lua | 45 |
2 files changed, 46 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/servers/init.lua b/lua/nvim-lsp-installer/servers/init.lua index abace672..6124ba5a 100644 --- a/lua/nvim-lsp-installer/servers/init.lua +++ b/lua/nvim-lsp-installer/servers/init.lua @@ -99,6 +99,7 @@ local CORE_SERVERS = Data.set_of { "texlab", "tflint", "tsserver", + "vala_ls", "vimls", "volar", "vuels", diff --git a/lua/nvim-lsp-installer/servers/vala_ls/init.lua b/lua/nvim-lsp-installer/servers/vala_ls/init.lua new file mode 100644 index 00000000..5ed52b4e --- /dev/null +++ b/lua/nvim-lsp-installer/servers/vala_ls/init.lua @@ -0,0 +1,45 @@ +local server = require "nvim-lsp-installer.server" +local path = require "nvim-lsp-installer.path" +local std = require "nvim-lsp-installer.installers.std" +local context = require "nvim-lsp-installer.installers.context" +local installers = require "nvim-lsp-installer.installers" +local process = require "nvim-lsp-installer.process" + +return function(name, root_dir) + return server.Server:new { + name = name, + root_dir = root_dir, + homepage = "https://wiki.gnome.org/Projects/Vala", + installer = { + std.ensure_executables { + { "meson", "meson was not found in path. Refer to https://mesonbuild.com/Getting-meson.html" }, + { "ninja", "ninja was not found in path. Refer to https://ninja-build.org/" }, + { "valac", "valac was not found in path. Refer to https://wiki.gnome.org/Projects/Vala" }, + }, + context.github_release_file("Prince781/vala-language-server", function(version) + return ("vala-language-server-%s.tar.xz"):format(version) + end), + context.capture(function(ctx) + return installers.pipe { + std.untarxz_remote(ctx.github_release_file), + std.rename(("vala-language-server-%s"):format(ctx.requested_server_version), "vala-language-server"), + } + end), + function(server, callback, context) + local c = process.chain { + cwd = path.concat { server.root_dir, "vala-language-server" }, + stdio_sink = context.stdio_sink, + } + + c.run("meson", { ("-Dprefix=%s"):format(server.root_dir), "build" }) + c.run("ninja", { "-C", "build", "install" }) + + c.spawn(callback) + end, + std.rmrf "vala-language-server", + }, + default_options = { + cmd = { path.concat { root_dir, "bin", "vala-language-server" } }, + }, + } +end |
