diff options
| author | William Boman <william@redwill.se> | 2022-01-24 19:36:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-24 19:36:26 +0100 |
| commit | ac77c604a03e04f6415925064bdd7671c75e9957 (patch) | |
| tree | 789a45b690f13c5ea17a5c576042bb5b0c6386d5 /lua | |
| parent | add verible (#443) (diff) | |
| download | mason-ac77c604a03e04f6415925064bdd7671c75e9957.tar mason-ac77c604a03e04f6415925064bdd7671c75e9957.tar.gz mason-ac77c604a03e04f6415925064bdd7671c75e9957.tar.bz2 mason-ac77c604a03e04f6415925064bdd7671c75e9957.tar.lz mason-ac77c604a03e04f6415925064bdd7671c75e9957.tar.xz mason-ac77c604a03e04f6415925064bdd7671c75e9957.tar.zst mason-ac77c604a03e04f6415925064bdd7671c75e9957.zip | |
add beancount (#445)
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-lsp-installer/_generated/filetype_map.lua | 1 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/_generated/metadata.lua | 3 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/installers/pip3.lua | 8 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/servers/beancount/init.lua | 53 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/servers/init.lua | 1 |
5 files changed, 63 insertions, 3 deletions
diff --git a/lua/nvim-lsp-installer/_generated/filetype_map.lua b/lua/nvim-lsp-installer/_generated/filetype_map.lua index 71784291..2c9eeee4 100644 --- a/lua/nvim-lsp-installer/_generated/filetype_map.lua +++ b/lua/nvim-lsp-installer/_generated/filetype_map.lua @@ -8,6 +8,7 @@ return { astro = { "tailwindcss" }, ["astro-markdown"] = { "tailwindcss" }, awk = { "awk_ls" }, + beancount = { "beancount" }, bib = { "ltex", "texlab" }, bicep = { "bicep" }, blade = { "tailwindcss" }, diff --git a/lua/nvim-lsp-installer/_generated/metadata.lua b/lua/nvim-lsp-installer/_generated/metadata.lua index af30dcba..619ede96 100644 --- a/lua/nvim-lsp-installer/_generated/metadata.lua +++ b/lua/nvim-lsp-installer/_generated/metadata.lua @@ -19,6 +19,9 @@ return { bashls = { filetypes = { "sh" } }, + beancount = { + filetypes = { "beancount" } + }, bicep = { filetypes = { "bicep" } }, diff --git a/lua/nvim-lsp-installer/installers/pip3.lua b/lua/nvim-lsp-installer/installers/pip3.lua index b4dc4f5a..9476318d 100644 --- a/lua/nvim-lsp-installer/installers/pip3.lua +++ b/lua/nvim-lsp-installer/installers/pip3.lua @@ -73,10 +73,12 @@ end ---@param root_dir string @The directory to resolve the executable from. function M.env(root_dir) return { - PATH = process.extend_path { - path.concat { root_dir, REL_INSTALL_DIR, platform.is_win and "Scripts" or "bin" }, - }, + PATH = process.extend_path { M.path(root_dir) }, } end +function M.path(root_dir) + return path.concat { root_dir, REL_INSTALL_DIR, platform.is_win and "Scripts" or "bin" } +end + return M diff --git a/lua/nvim-lsp-installer/servers/beancount/init.lua b/lua/nvim-lsp-installer/servers/beancount/init.lua new file mode 100644 index 00000000..9d536122 --- /dev/null +++ b/lua/nvim-lsp-installer/servers/beancount/init.lua @@ -0,0 +1,53 @@ +local server = require "nvim-lsp-installer.server" +local installers = require "nvim-lsp-installer.installers" +local context = require "nvim-lsp-installer.installers.context" +local pip3 = require "nvim-lsp-installer.installers.pip3" +local std = require "nvim-lsp-installer.installers.std" +local Data = require "nvim-lsp-installer.data" +local platform = require "nvim-lsp-installer.platform" +local process = require "nvim-lsp-installer.process" + +local coalesce, when = Data.coalesce, Data.when + +return function(name, root_dir) + print(process.extend_path { root_dir, pip3.path(root_dir) }) + return server.Server:new { + name = name, + root_dir = root_dir, + languages = { "beancount" }, + homepage = "https://github.com/polarmutex/beancount-language-server", + installer = { + context.use_github_release_file( + "polarmutex/beancount-language-server", + coalesce( + when(platform.is_mac, "beancount-language-server-macos-x64.zip"), + when(platform.is_linux and platform.arch == "x64", "beancount-language-server-linux-x64.zip"), + when(platform.is_win and platform.arch == "x64", "beancount-language-server-windows-x64.zip") + ) + ), + context.capture(function(ctx) + return installers.pipe { + std.unzip_remote(ctx.github_release_file), + std.rename("beancount-language-server", "beancount-langserver"), -- to conform with lspconfig + } + end), + context.promote_install_dir(), + installers.branch_context { + context.set(function(ctx) + ctx.requested_server_version = nil + end), + pip3.packages { "beancount" }, + }, + context.receipt(function(receipt, ctx) + receipt + :with_primary_source(receipt.github_release_file(ctx)) + :with_secondary_source(receipt.pip3 "beancount") + end), + }, + default_options = { + cmd_env = { + PATH = process.extend_path { root_dir, pip3.path(root_dir) }, + }, + }, + } +end diff --git a/lua/nvim-lsp-installer/servers/init.lua b/lua/nvim-lsp-installer/servers/init.lua index 05bb65e4..7ce1ea7a 100644 --- a/lua/nvim-lsp-installer/servers/init.lua +++ b/lua/nvim-lsp-installer/servers/init.lua @@ -37,6 +37,7 @@ local CORE_SERVERS = Data.set_of { "asm_lsp", "awk_ls", "bashls", + "beancount", "bicep", "ccls", "clangd", |
