fix lsp issues; up

This commit is contained in:
jmarkin 2025-11-12 21:36:45 +03:00
parent d5fb48d870
commit 6373116d06
14 changed files with 105 additions and 89 deletions

View file

@ -98,11 +98,11 @@
"nixpkgs-lib": "nixpkgs-lib_2"
},
"locked": {
"lastModified": 1762440070,
"narHash": "sha256-xxdepIcb39UJ94+YydGP221rjnpkDZUlykKuF54PsqI=",
"lastModified": 1762810396,
"narHash": "sha256-dxFVgQPG+R72dkhXTtqUm7KpxElw3u6E+YlQ2WaDgt8=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "26d05891e14c88eb4a5d5bee659c0db5afb609d8",
"rev": "0bdadb1b265fb4143a75bd1ec7d8c915898a9923",
"type": "github"
},
"original": {
@ -257,11 +257,11 @@
"kulala-nvim": {
"flake": false,
"locked": {
"lastModified": 1762151137,
"narHash": "sha256-NQZGW4RblskDrARb8TwzufJgSClNnuIdv7twTIlYfYs=",
"lastModified": 1762842180,
"narHash": "sha256-TXbcy4Pjth9FfBcgnESuSQzdqRsRI5nPUocbNbpV8g4=",
"owner": "mistweaverco",
"repo": "kulala.nvim",
"rev": "c328aeb219c4b77106917dd2698c90ea9657281b",
"rev": "8676a4ffc654d9f9404b343982390bea568da737",
"type": "github"
},
"original": {
@ -329,11 +329,11 @@
]
},
"locked": {
"lastModified": 1762560310,
"narHash": "sha256-xmXc/A187ItfvHQjaJUL1ciiunIsrRkWknZwcgl2s8I=",
"lastModified": 1762905877,
"narHash": "sha256-Leao4Ts2loeMfslCEC2xjy6UH7H7C7g2u6yX/HqWYbM=",
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"rev": "fbc6a67d4bdc7ef09a17e985109c5cb1ed287ed6",
"rev": "a8d1fa088164a7f4df2161a86d18d91b7100064c",
"type": "github"
},
"original": {
@ -345,11 +345,11 @@
"neovim-src": {
"flake": false,
"locked": {
"lastModified": 1762474970,
"narHash": "sha256-z2lLrDK3WRgGS9LA4KEQRgYxnZiVXh+bdg09puaBfk4=",
"lastModified": 1762904335,
"narHash": "sha256-52qh41MWguVgvnmvFvBAoU76x1zDO88LYc0l86aMaGo=",
"owner": "neovim",
"repo": "neovim",
"rev": "af5ac171bde3ae7f961a23e9464309cee7ef9c13",
"rev": "97cb0d55717f0b9ffe0748d4cd220217abc51a63",
"type": "github"
},
"original": {
@ -422,11 +422,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1762363567,
"narHash": "sha256-YRqMDEtSMbitIMj+JLpheSz0pwEr0Rmy5mC7myl17xs=",
"lastModified": 1762844143,
"narHash": "sha256-SlybxLZ1/e4T2lb1czEtWVzDCVSTvk9WLwGhmxFmBxI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ae814fd3904b621d8ab97418f1d0f2eb0d3716f4",
"rev": "9da7f1cf7f8a6e2a7cb3001b048546c92a8258b4",
"type": "github"
},
"original": {
@ -528,11 +528,11 @@
"smart-splits-nvim": {
"flake": false,
"locked": {
"lastModified": 1762552577,
"narHash": "sha256-ybYcPGdP1N5tKVxTck8eXu19nDXb8ZxLRYLuHNjey4Y=",
"lastModified": 1762958613,
"narHash": "sha256-2YeMg76UeLQd2XtLJQnFbaaRTReMowC5o8k5KEyYwUk=",
"owner": "mrjones2014",
"repo": "smart-splits.nvim",
"rev": "601cc6422b2b94af2e88d14358b81cf7dfb5db5f",
"rev": "63b17752f7f1d8cd19079953fb7450ecca1e546e",
"type": "github"
},
"original": {

View file

@ -1,6 +1,17 @@
{
description = "Neovim derivation";
nixConfig = {
extra-substituters = [
"http://192.168.88.15:8501"
"http://tln.jmarkin.ru:8501"
];
extra-trusted-public-keys = [
"192.168.88.15:EOj0yG2nmqNFVZA1GWYKZ8JU8uZHbAzvYXglA8u+yKw="
"tln.jmarkin.ru:EOj0yG2nmqNFVZA1GWYKZ8JU8uZHbAzvYXglA8u+yKw="
];
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
@ -24,7 +35,7 @@
# Add bleeding-edge plugins here.
# They can be updated with `nix flake update` (make sure to commit the generated flake.lock)
smart-splits-nvim = {
url = "github:mrjones2014/smart-splits.nvim";
flake = false;

View file

@ -49,19 +49,5 @@ in
}
'';
}
{
plugin = fidget-nvim;
type = "lua";
optional = true;
config = /*lua*/''
lze.load {
"${fidget-nvim.pname}",
event="LspAttach",
after=function()
require("fidget").setup({})
end
}
'';
}
] ++ builtins.concatMap (x: x.plugins) langs;
}

View file

@ -4,6 +4,7 @@
packages = with pkgs; [
vscode-langservers-extracted
biome
prettierd
nodejs
bun
yarn-berry
@ -22,7 +23,13 @@
event = vim.g.pre_load_events,
after = function()
require("typescript-tools").setup {
tsserver_path = "${pkgs.typescript}/bin/tsserver"
tsserver_path = "${pkgs.typescript}/bin/tsserver",
settings = {
tsserver_max_memory = 4096,
tsserver_file_preferences = {
includeCompletionsForModuleExports = true,
},
},
}
end
}

View file

@ -174,6 +174,14 @@ with final.pkgs.lib; let
}
'';
}
{
plugin = mini-notify;
optional = false;
type = "lua";
config = /*lua*/ ''
require('mini.notify').setup();
'';
}
])
++ (callPackage ./treesitter.nix)
++ (callPackage ./statusline.nix)

View file

@ -24,5 +24,5 @@ return {
"vue",
},
workspace_required = true,
root_dir = vim.g.js_root_pattern
root_dir = vim.g.js_root_pattern,
}

View file

@ -1,38 +0,0 @@
return {
settings = {
checkOnSave = true,
completion = {
autoimport = {
enable = false,
},
},
procMacro = {
enable = true,
},
files = {
excludeDirs = {
".direnv",
"_build",
".dart_tool",
".flatpak-builder",
".git",
".gitlab",
".gitlab-ci",
".gradle",
".idea",
".next",
".project",
".scannerwork",
".settings",
".venv",
"archetype-resources",
"bin",
"hooks",
"node_modules",
"po",
"screenshots",
"target",
},
},
},
}

View file

@ -137,12 +137,6 @@ local function optimize_buffer(bufnr, path)
vim.opt_local.undofile = false
end
-- pcall_notify(function()
-- require("rainbow-delimiters").disable(bufnr)
-- end)
pcall_notify(function()
require("ufo").detach(bufnr)
end)
pcall_notify(function()
require("gitsigns.attach").detach(bufnr)
end)
@ -151,10 +145,6 @@ local function optimize_buffer(bufnr, path)
require("local-highlight").detach(bufnr)
end)
-- pcall_notify(function()
-- require('smear_cursor').enabled = false
-- end)
if _type == FILE_TYPE.READ_ONLY then
vim.opt_local.buftype = "nowrite"
end

View file

@ -256,7 +256,6 @@ M.setup_autocmds = function()
desc = "attach lsp event",
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if not client then
return
end
@ -274,6 +273,7 @@ M.setup_autocmds = function()
if out then
vim.b[args.buf].lsp_attached[client.id] = nil
end
return
end
vim.b[args.buf].lsp_attached[client.id] = 1

View file

@ -11,7 +11,6 @@ g.formatters_by_ft = {
lua = { "stylua" },
python = { "ruff_format" },
rust = { "rustfmt" },
javascript = { "prettierd" },
json = { "fixjson" },
jinja = { "djlint" },
htmldjango = { "djlint" },

51
nvim/plugin/lang.lua Normal file
View file

@ -0,0 +1,51 @@
if vim.g.did_load_lang_plugin then
return
end
vim.g.did_load_lang_plugin = true
vim.g.rustaceanvim = {
tools = {},
server = {
on_attach = function(client, bufnr) end,
default_settings = {
["rust-analyzer"] = {
checkOnSave = true,
completion = {
autoimport = {
enable = false,
},
},
procMacro = {
enable = true,
},
files = {
excludeDirs = {
".direnv",
"_build",
".dart_tool",
".flatpak-builder",
".git",
".gitlab",
".gitlab-ci",
".gradle",
".idea",
".next",
".project",
".scannerwork",
".settings",
".venv",
"archetype-resources",
"bin",
"hooks",
"node_modules",
"po",
"screenshots",
"target",
},
},
},
},
},
-- DAP configuration
dap = {},
}

View file

@ -21,7 +21,7 @@ end, {
local complete_client = function(arg)
return vim
.iter(vim.lsp.get_clients())
.iter(require("lsp").get_lsps())
:map(function(client)
return client.name
end)
@ -53,7 +53,7 @@ api.nvim_create_user_command("LspStart", function(info)
-- otherwise they won't be present in the private `vim.lsp.config._configs` table.
if #servers == 0 then
local filetype = vim.bo.filetype
for name, _ in pairs(vim.lsp.config._configs) do
for name, _ in pairs(require("lsp").get_lsps()) do
local filetypes = vim.lsp.config[name].filetypes
if filetypes and vim.tbl_contains(filetypes, filetype) then
table.insert(servers, name)

View file

@ -96,7 +96,7 @@ lze.load({
})
lze.load({
"${render-markdown-nvim.pname}",
"render-markdown.nvim",
ft = { "markdown", "codecompanion", "Avante" },
after = function()
require("render-markdown").setup({

View file

@ -1 +1,3 @@
import s
var s = ''
s