From 2497b9b54d5b73d93f59d36f5003c5b627dd8eb9 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Fri, 13 Oct 2023 20:44:34 +0900 Subject: [PATCH] new: nvim: rewrite julials managing scripts with julia for cross-platform compatibility --- bin/neovim/setup_julials.jl | 16 ++++++++++++++++ bin/neovim/update_julials.jl | 11 +++++++++++ dotfiles/neovim/init.lua | 7 ++++++- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 bin/neovim/setup_julials.jl create mode 100644 bin/neovim/update_julials.jl diff --git a/bin/neovim/setup_julials.jl b/bin/neovim/setup_julials.jl new file mode 100644 index 0000000..5c28658 --- /dev/null +++ b/bin/neovim/setup_julials.jl @@ -0,0 +1,16 @@ +#!/usr/bin/julia +project_path = joinpath(homedir(), ".julia", "environments", "nvim-lspconfig") +if !ispath(project_path) + try + mkdir(project_path) + @info "Created $(project_path)" + catch e + @error e + @error dump(e) + throw(e) + end +end +cmd = `julia --project=$(project_path) $(@__DIR__)/add_dependencies.jl` +@info cmd +run(cmd) + diff --git a/bin/neovim/update_julials.jl b/bin/neovim/update_julials.jl new file mode 100644 index 0000000..ffb3e1f --- /dev/null +++ b/bin/neovim/update_julials.jl @@ -0,0 +1,11 @@ +#!/usr/bin/julia +project_path = joinpath(homedir(), ".julia", "environments", "nvim-lspconfig") +cd(project_path) +@info "now at " pwd() +run(`julia --project=. -e 'using Pkg; Pkg.update()'`) +read("precompile_exec_head.jl", String) * read("tracecompile.jl", String) |> (b -> write("precompile_exec.jl", b)) +@info "compiling sysimage..." +run(`julia --project=. -e 'using PackageCompiler; create_sysimage(["LanguageServer"], sysimage_path = "sys-ls.so", precompile_execution_file = ["precompile_exec.jl"])'`) +@info "post precompile" +run(`julia --project=. -J sys-ls.so -e 'using Pkg; Pkg.precompile()'`) + diff --git a/dotfiles/neovim/init.lua b/dotfiles/neovim/init.lua index a553185..2dd7baa 100644 --- a/dotfiles/neovim/init.lua +++ b/dotfiles/neovim/init.lua @@ -533,8 +533,13 @@ lspconfig.powershell_es.setup { -- -- jetls -- lspconfig.jetls.setup {} -- ccls +-- -- csharp +-- lspconfig.omnisharp.setup { +-- cmd = {'omnisharp'}, +-- } -local lss = { "pyright", "rust_analyzer", "texlab", "ccls", "clangd", "tsserver", --[["tailwindcss"]] "hls", "cmake", "html", } +local lss = { "pyright", "rust_analyzer", "texlab", "ccls", "clangd", "tsserver", --[["tailwindcss"]] "hls", "cmake", + "csharp_ls", "html", } for _, ls in pairs(lss) do lspconfig[ls].setup { on_attach = on_attach,