From 68b8e323f474b59c87f54aacfade9f6667dd0ae6 Mon Sep 17 00:00:00 2001 From: Micah Halter Date: Thu, 27 Jun 2024 16:13:20 -0400 Subject: [PATCH] fix(julia): only install the julia language server from Mason if not setup manually --- lua/astrocommunity/pack/julia/init.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lua/astrocommunity/pack/julia/init.lua b/lua/astrocommunity/pack/julia/init.lua index f96e453be..2c079a1a5 100644 --- a/lua/astrocommunity/pack/julia/init.lua +++ b/lua/astrocommunity/pack/julia/init.lua @@ -1,3 +1,9 @@ +-- Julia language server may be setup manually to use local system images. We should ignore installing the package +-- from Mason if that's the case because it completely changes how the Julia Language Server works +local function julials_manually_setup() + return vim.tbl_contains(vim.tbl_get(require("astrocore").plugin_opts "astrolsp", "servers") or {}, "julials") +end + return { { import = "astrocommunity.pack.toml" }, { import = "astrocommunity.completion.cmp-latex-symbols" }, @@ -14,14 +20,18 @@ return { "williamboman/mason-lspconfig.nvim", optional = true, opts = function(_, opts) - opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "julials" }) + if not julials_manually_setup() then + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "julials" }) + end end, }, { "WhoIsSethDaniel/mason-tool-installer.nvim", optional = true, opts = function(_, opts) - opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "julia-lsp" }) + if not julials_manually_setup() then + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "julia-lsp" }) + end end, }, }