From dbab80f182555a2c9f7b821cb66fe6104bf35b11 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 6 Oct 2023 20:30:13 +0900 Subject: [PATCH] update: nvim: julials use sysimage only if it exists --- dotfiles/neovim/init.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index 949b4a5..f8f5015 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -461,11 +461,20 @@ lspconfig.lua_ls.setup { }, } -- Julia +-- use sysimage only if it exists +local julials_so = os.getenv("HOME") .. "/.julia/environments/nvim-lspconfig/sys-ls.so" +local julials_so_option = { "", ""} +if io.open(julials_so) then + julials_so_option = { + "-J", julials_so + } +end +-- main lspconfig.julials.setup { on_attach = on_attach, capabilities = capabilities, - cmd = { "julia", "--startup-file=no", "--history-file=no", "-J", - os.getenv("HOME") .. "/.julia/environments/nvim-lspconfig/sys-ls.so", + cmd = { "julia", "--startup-file=no", "--history-file=no", + julials_so_option[1], julials_so_option[2], -- use below 2 lines to collect script to be included in sysimage '--trace-compile', os.getenv("HOME") .. "/.julia/environments/nvim-lspconfig/tracecompile.jl",