Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cpp): add support for linux/arm64 #997

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
},
}
Loading