Skip to content

Commit

Permalink
feat(cpp-pack) add support for linux/arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
joshheyse committed May 27, 2024
1 parent d64d788 commit 105c551
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions lua/astrocommunity/pack/cpp/init.lua
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
local machine = vim.loop.os_uname().machine
local is_arm = machine == "aarch64" or machine.starts "arm"

return {
{
"AstroNvim/astrolsp",
optional = true,
---@type AstroLSPOpts
opts = {
opts = function(_, opts)
---@diagnostic disable: missing-fields
config = {
opts = vim.tbl_deep_extend("keep", opts, {
clangd = {
capabilities = {
offsetEncoding = "utf-8",
},
},
},
},
servers = {},
})
-- opts.clangd.capabilities.offsetEncoding = "utf-8"
if is_arm then opts.servers = require("astrocore").list_insert_unique(opts.servers, { "clangd" }) end
return opts
end,
},
{
"nvim-treesitter/nvim-treesitter",
Expand All @@ -28,7 +34,9 @@ return {
"williamboman/mason-lspconfig.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "clangd" })
if not is_arm then
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "clangd" })
end
end,
},
{
Expand Down Expand Up @@ -86,7 +94,11 @@ return {
"WhoIsSethDaniel/mason-tool-installer.nvim",
optional = true,
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "clangd", "codelldb" })
if not is_arm then
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "clangd", "codelldb" })
else
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "codelldb" })
end
end,
},
}

0 comments on commit 105c551

Please sign in to comment.