aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/ccls/linux.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-07-06 19:41:43 +0200
committerWilliam Boman <william@redwill.se>2022-07-07 00:39:59 +0200
commit5f634e0c37e723fc0c33e06b4fd5c2180178db40 (patch)
treefa4f09363adefa8259e23e4d1ea036db628b1243 /lua/nvim-lsp-installer/servers/ccls/linux.lua
parentfeat(health): use stderr for java version, also check for JAVA_HOME (#765) (diff)
downloadmason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.tar
mason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.tar.gz
mason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.tar.bz2
mason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.tar.lz
mason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.tar.xz
mason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.tar.zst
mason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.zip
mason.nvim
Diffstat (limited to 'lua/nvim-lsp-installer/servers/ccls/linux.lua')
-rw-r--r--lua/nvim-lsp-installer/servers/ccls/linux.lua73
1 files changed, 0 insertions, 73 deletions
diff --git a/lua/nvim-lsp-installer/servers/ccls/linux.lua b/lua/nvim-lsp-installer/servers/ccls/linux.lua
deleted file mode 100644
index 44bd29ca..00000000
--- a/lua/nvim-lsp-installer/servers/ccls/linux.lua
+++ /dev/null
@@ -1,73 +0,0 @@
-local path = require "nvim-lsp-installer.core.path"
-local platform = require "nvim-lsp-installer.core.platform"
-local installer = require "nvim-lsp-installer.core.installer"
-local github = require "nvim-lsp-installer.core.managers.github"
-local functional = require "nvim-lsp-installer.core.functional"
-local Result = require "nvim-lsp-installer.core.result"
-local Optional = require "nvim-lsp-installer.core.optional"
-
-local ccls_installer = require "nvim-lsp-installer.servers.ccls.common"
-
-local coalesce, when = functional.coalesce, functional.when
-
----@param release string
-local function normalize_llvm_release(release)
- -- Strip the "llvmorg-" prefix from tags (llvm releases tags like llvmorg-13.0.0)
- local normalized_release = release:gsub("^llvmorg%-", "")
- return normalized_release
-end
-
----@async
-local function llvm_installer()
- local ctx = installer.context()
- local os_dist = platform.os_distribution()
-
- local asset_name = coalesce(
- when(
- platform.arch == "x64",
- coalesce(
- when(
- os_dist.id == "ubuntu" and os_dist.version.major >= 20,
- "clang+llvm-%s-x86_64-linux-gnu-ubuntu-20.04"
- ),
- when(
- os_dist.id == "ubuntu" and os_dist.version.major >= 16,
- "clang+llvm-%s-x86_64-linux-gnu-ubuntu-16.04"
- )
- )
- ),
- when(platform.arch == "arm64", "clang+llvm-%s-aarch64-linux-gnu"),
- when(platform.arch == "armv7", "clang+llvm-%s-armv7a-linux-gnueabihf")
- )
-
- local source = github.untarxz_release_file {
- repo = "llvm/llvm-project",
- version = Optional.of "llvmorg-13.0.0",
- asset_file = function(release)
- local normalized_release = normalize_llvm_release(release)
- return asset_name and ("%s.tar.xz"):format(asset_name):format(normalized_release)
- end,
- }
-
- ctx.fs:rename(asset_name:format(normalize_llvm_release(source.release)), "llvm")
- -- We move the clang headers out, because they need to be persisted
- ctx.fs:rename(path.concat { "llvm", "lib", "clang", normalize_llvm_release(source.release) }, "clang-resource")
-
- return path.concat { ctx.cwd:get(), "llvm" }
-end
-
----@async
-return function()
- local ctx = installer.context()
- Result.run_catching(llvm_installer)
- :map(function(llvm_dir)
- ccls_installer { llvm_dir = llvm_dir }
- ctx.fs:rmrf "llvm"
- end)
- :recover(function()
- pcall(function()
- ctx.fs:rmrf "llvm"
- end)
- ccls_installer {}
- end)
-end