Compare commits
No commits in common. "c9026eb8429c38f0d76c1b8a26ba22aa8cf7e949" and "b40e8ad32960a44e225b5e131ab02164c9795b46" have entirely different histories.
c9026eb842
...
b40e8ad329
6 changed files with 19 additions and 58 deletions
|
@ -6,25 +6,24 @@ using Pkg
|
||||||
# add LanguageServer.jl
|
# add LanguageServer.jl
|
||||||
Pkg.add("LanguageServer")
|
Pkg.add("LanguageServer")
|
||||||
|
|
||||||
# add PackageCompiler.jl
|
# add dependencies of LanguageServer.jl
|
||||||
Pkg.add("PackageCompiler")
|
pkg_ls = Pkg.project().dependencies["LanguageServer"]
|
||||||
|
pkg_ls_deps = Pkg.dependencies()[pkg_ls].dependencies |> keys
|
||||||
|
foreach(Pkg.add, pkg_ls_deps)
|
||||||
|
|
||||||
# add extra dependencies
|
# add extra dependencies
|
||||||
# these packages are manually collected
|
# these packages are manually collected
|
||||||
pkg_extra = ["Logging", "Sockets", "DataStructures", "Tar", "ArgTools", "Dates", "Downloads", "TOML", "JSONRPC", "SymbolServer"]
|
pkg_extra = ["Logging", "Sockets", "DataStructures", "Tar", "ArgTools", "Dates", "Downloads", "TOML"]
|
||||||
Pkg.add(pkg_extra)
|
foreach(Pkg.add, pkg_extra)
|
||||||
@info "added dependencies"
|
@info "dependency added"
|
||||||
|
|
||||||
# Extra package to be executed in precompiled code
|
|
||||||
pkg_precompiled = []
|
|
||||||
|
|
||||||
# save pkgs to be used for precompile functions with traced script
|
# save pkgs to be used for precompile functions with traced script
|
||||||
out_path = joinpath(Pkg.project().path |> dirname, "precompile_exec_head.jl")
|
out_path = joinpath(Pkg.project().path |> dirname, "precompile_exec_head.jl")
|
||||||
@info "writing $(out_path)"
|
@info "writing $(out_path)"
|
||||||
open(out_path, "w") do io
|
open(out_path, "w") do io
|
||||||
println(io, "using LanguageServer")
|
println(io, "using LanguageServer")
|
||||||
|
println(io, "using " * join(pkg_ls_deps, ", "))
|
||||||
println(io, "using " * join(pkg_extra, ", "))
|
println(io, "using " * join(pkg_extra, ", "))
|
||||||
# println(io, "using " * join(pkg_precompiled, ", "))
|
|
||||||
if Sys.iswindows()
|
if Sys.iswindows()
|
||||||
println(io, "import FileWatching")
|
println(io, "import FileWatching")
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,8 +5,7 @@ if !ispath(project_path)
|
||||||
@info "Created $(project_path)"
|
@info "Created $(project_path)"
|
||||||
touch(joinpath(project_path, "tracecompile.jl"))
|
touch(joinpath(project_path, "tracecompile.jl"))
|
||||||
end
|
end
|
||||||
|
cmd = `julia --project=$(project_path) $(@__DIR__)/add_dependencies.jl`
|
||||||
using Pkg
|
@info cmd
|
||||||
Pkg.activate(project_path)
|
run(cmd)
|
||||||
include("$(@__DIR__)/add_dependencies.jl")
|
|
||||||
|
|
||||||
|
|
|
@ -2,17 +2,14 @@
|
||||||
project_path = joinpath(homedir(), ".julia", "environments", "nvim-lspconfig")
|
project_path = joinpath(homedir(), ".julia", "environments", "nvim-lspconfig")
|
||||||
cd(project_path) do
|
cd(project_path) do
|
||||||
@info "now at " pwd()
|
@info "now at " pwd()
|
||||||
using Pkg
|
run(`julia --project=. -e 'using Pkg; Pkg.update()'`)
|
||||||
Pkg.activate(".")
|
|
||||||
Pkg.update()
|
|
||||||
compile_traces = Iterators.filter(eachline("tracecompile.jl")) do line
|
compile_traces = Iterators.filter(eachline("tracecompile.jl")) do line
|
||||||
# Remove anonymous functions from compile trace
|
# Remove anonymous functions from compile trace
|
||||||
!startswith(line, '#') && !occursin(r"\#\d+\#\d+", line) && !occursin(r"\#\#printstyled\#", line)
|
!startswith(line, '#') && !occursin(r"\#\d+\#\d+", line) && !occursin(r"\#\#printstyled\#", line)
|
||||||
end |> join
|
end |> join
|
||||||
read("precompile_exec_head.jl", String) * compile_traces |> (b -> write("precompile_exec.jl", b))
|
read("precompile_exec_head.jl", String) * compile_traces |> (b -> write("precompile_exec.jl", b))
|
||||||
@info "compiling sysimage..."
|
@info "compiling sysimage..."
|
||||||
using PackageCompiler;
|
run(`julia --project=. -e 'using PackageCompiler; create_sysimage(["LanguageServer"], sysimage_path = "sys-ls.so", precompile_execution_file = ["precompile_exec.jl"])'`)
|
||||||
create_sysimage(["LanguageServer"], sysimage_path = "sys-ls.so", precompile_execution_file = ["precompile_exec.jl"])'
|
|
||||||
@info "post precompile"
|
@info "post precompile"
|
||||||
run(`julia --project=. -J sys-ls.so -e 'using Pkg; Pkg.precompile()'`)
|
run(`julia --project=. -J sys-ls.so -e 'using Pkg; Pkg.precompile()'`)
|
||||||
end
|
end
|
||||||
|
|
|
@ -24,25 +24,6 @@ if status is-interactive
|
||||||
|
|
||||||
# opam
|
# opam
|
||||||
#source ~/.opam/opam-init/init.fish > /dev/null 2> /dev/null; or true
|
#source ~/.opam/opam-init/init.fish > /dev/null 2> /dev/null; or true
|
||||||
|
|
||||||
function rga-fzf
|
|
||||||
set RG_PREFIX 'rga --files-with-matches'
|
|
||||||
if test (count $argv) -gt 1
|
|
||||||
set RG_PREFIX "$RG_PREFIX $argv[1..-2]"
|
|
||||||
end
|
|
||||||
set -l file $file
|
|
||||||
set file (
|
|
||||||
FZF_DEFAULT_COMMAND="$RG_PREFIX '$argv[-1]'" \
|
|
||||||
fzf --sort \
|
|
||||||
--preview='test ! -z {} && \
|
|
||||||
rga --pretty --context 5 {q} {}' \
|
|
||||||
--phony -q "$argv[-1]" \
|
|
||||||
--bind "change:reload:$RG_PREFIX {q}" \
|
|
||||||
--preview-window='50%:wrap'
|
|
||||||
) && \
|
|
||||||
echo "opening $file" && \
|
|
||||||
open "$file"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# starship
|
# starship
|
||||||
|
|
|
@ -114,9 +114,6 @@ require('lazy').setup({
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||||
{
|
|
||||||
"nvim-treesitter/nvim-treesitter-context"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -498,7 +495,6 @@ vim.keymap.set('n', '<leader>fli', builtin.lsp_incoming_calls, { desc = "lsp inc
|
||||||
vim.keymap.set('n', '<leader>flo', builtin.lsp_outgoing_calls, { desc = "lsp outgoing calls" })
|
vim.keymap.set('n', '<leader>flo', builtin.lsp_outgoing_calls, { desc = "lsp outgoing calls" })
|
||||||
vim.keymap.set('n', '<leader>fll', builtin.lsp_implementations, { desc = "lsp implementations" })
|
vim.keymap.set('n', '<leader>fll', builtin.lsp_implementations, { desc = "lsp implementations" })
|
||||||
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = "buffers" })
|
vim.keymap.set('n', '<leader>fb', builtin.buffers, { desc = "buffers" })
|
||||||
vim.keymap.set('n', '<leader>fz', builtin.current_buffer_fuzzy_find, { desc = "current buffer fuzzy find" })
|
|
||||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = "grep" })
|
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = "grep" })
|
||||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = "help tags" })
|
vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = "help tags" })
|
||||||
vim.keymap.set('n', '<leader>fc', builtin.git_commits, { desc = "git commit" })
|
vim.keymap.set('n', '<leader>fc', builtin.git_commits, { desc = "git commit" })
|
||||||
|
@ -633,7 +629,6 @@ local on_attach = function(client, bufnr)
|
||||||
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
||||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||||
vim.keymap.set('n', 'gT', vim.lsp.buf.type_definition, bufopts)
|
|
||||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||||
vim.keymap.set('n', 'g1', vim.lsp.buf.implementation, bufopts)
|
vim.keymap.set('n', 'g1', vim.lsp.buf.implementation, bufopts)
|
||||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
||||||
|
@ -691,7 +686,7 @@ lspconfig.julials.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
cmd = { "julia", "--startup-file=no", "--history-file=no",
|
cmd = { "julia", "--startup-file=no", "--history-file=no",
|
||||||
-- julials_so_option[1], julials_so_option[2],
|
julials_so_option[1], julials_so_option[2],
|
||||||
-- use below 2 lines to collect script to be included in sysimage
|
-- use below 2 lines to collect script to be included in sysimage
|
||||||
-- '--trace-compile',
|
-- '--trace-compile',
|
||||||
-- vim.env.HOME .. "/.julia/environments/nvim-lspconfig/tracecompile.jl",
|
-- vim.env.HOME .. "/.julia/environments/nvim-lspconfig/tracecompile.jl",
|
||||||
|
@ -766,28 +761,18 @@ lspconfig.tinymist.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
single_file_support = true,
|
single_file_support = true,
|
||||||
-- offset_encoding = "utf-8",
|
|
||||||
settings = {
|
|
||||||
formatterMode = "typstyle",
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lspconfig.rust_analyzer.setup {
|
lspconfig.rust_analyzer.setup {
|
||||||
on_attach = function(client, bufnr)
|
on_attach = on_attach,
|
||||||
on_attach(client, bufnr)
|
|
||||||
vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
|
|
||||||
end,
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
settings = {
|
settings = {
|
||||||
['rust-analyzer'] = {
|
['rust-analyzer'] = {
|
||||||
cargo = {
|
|
||||||
features = "all",
|
|
||||||
},
|
|
||||||
check = {
|
check = {
|
||||||
command = "clippy",
|
command = "clippy",
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local lss = { "pyright", "texlab", --[[ "ccls", ]] "clangd", "ts_ls", --[["tailwindcss"]] "hls", "cmake",
|
local lss = { "pyright", "texlab", --[[ "ccls", ]] "clangd", "ts_ls", --[["tailwindcss"]] "hls", "cmake",
|
||||||
|
|
|
@ -139,7 +139,7 @@ function Enable-SshAgent {
|
||||||
.OUTPUTS
|
.OUTPUTS
|
||||||
no outputs
|
no outputs
|
||||||
#>
|
#>
|
||||||
sudo run pwsh -c "Set-Service -Name ssh-agent -StartupType Manual && Start-Service ssh-agent"
|
sudo Set-Service -Name ssh-agent -StartupType Manual && Start-Service ssh-agent
|
||||||
}
|
}
|
||||||
# auto start ssh-agent and do ssh-add
|
# auto start ssh-agent and do ssh-add
|
||||||
function Invoke-SshAdd {
|
function Invoke-SshAdd {
|
||||||
|
|
Loading…
Add table
Reference in a new issue