mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-10-16 13:39:33 +00:00
treewide: remove usage of default_on_attach outside LspAttach
This commit is contained in:
parent
11fd1b7083
commit
c13edf9961
9 changed files with 16 additions and 31 deletions
|
@ -77,7 +77,6 @@ in {
|
|||
{
|
||||
vim.lsp.servers."*" = {
|
||||
capabilities = mkDefault (mkLuaInline "capabilities");
|
||||
on_attach = mkDefault (mkLuaInline "default_on_attach");
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -26,8 +26,6 @@
|
|||
workspace_required = true;
|
||||
on_attach = mkLuaInline ''
|
||||
function(client, bufnr)
|
||||
default_on_attach(client, bufnr)
|
||||
|
||||
local function switch_source_header(bufnr)
|
||||
local method_name = "textDocument/switchSourceHeader"
|
||||
local params = vim.lsp.util.make_text_document_params(bufnr)
|
||||
|
@ -77,8 +75,6 @@
|
|||
};
|
||||
on_attach = mkLuaInline ''
|
||||
function(client, bufnr)
|
||||
default_on_attach(client, bufnr)
|
||||
|
||||
local function switch_source_header(bufnr)
|
||||
local method_name = "textDocument/switchSourceHeader"
|
||||
local client = vim.lsp.get_clients({ bufnr = bufnr, name = "clangd", })[1]
|
||||
|
|
|
@ -63,12 +63,11 @@
|
|||
};
|
||||
on_attach = mkLuaInline ''
|
||||
function(client, bufnr)
|
||||
default_on_attach(client, bufnr)
|
||||
local oe = require("omnisharp_extended")
|
||||
${mkLspBinding "goToDefinition" "oe.lsp_definition"}
|
||||
${mkLspBinding "goToType" "oe.lsp_type_definition"}
|
||||
${mkLspBinding "listReferences" "oe.lsp_references"}
|
||||
${mkLspBinding "listImplementations" "oe.lsp_implementation"}
|
||||
local oe = require("omnisharp_extended")
|
||||
${mkLspBinding "goToDefinition" "oe.lsp_definition"}
|
||||
${mkLspBinding "goToType" "oe.lsp_type_definition"}
|
||||
${mkLspBinding "listReferences" "oe.lsp_references"}
|
||||
${mkLspBinding "listImplementations" "oe.lsp_implementation"}
|
||||
end
|
||||
'';
|
||||
settings = {
|
||||
|
|
|
@ -161,7 +161,6 @@ in {
|
|||
},
|
||||
|
||||
capabilities = capabilities,
|
||||
on_attach = default_on_attach;
|
||||
},
|
||||
${optionalString cfg.dap.enable ''
|
||||
debugger = {
|
||||
|
|
|
@ -10,11 +10,10 @@
|
|||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
inherit (lib.nvim.dag) entryAfter entryBefore;
|
||||
inherit (lib.nvim.dag) entryAfter;
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
inherit (lib.meta) getExe';
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (pkgs) haskellPackages;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
|
@ -34,7 +33,6 @@
|
|||
''
|
||||
function(client, bufnr)
|
||||
local ht = require("haskell-tools")
|
||||
default_on_attach(client, bufnr, ht)
|
||||
local opts = { noremap = true, silent = true, buffer = bufnr }
|
||||
vim.keymap.set('n', '<localleader>cl', vim.lsp.codelens.run, opts)
|
||||
vim.keymap.set('n', '<localleader>hs', ht.hoogle.hoogle_signature, opts)
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
};
|
||||
on_attach = mkLuaInline ''
|
||||
function(client, bufnr)
|
||||
default_on_attach(client, bufnr);
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightOrganizeImports', function()
|
||||
local params = {
|
||||
command = 'pyright.organizeimports',
|
||||
|
@ -89,7 +88,6 @@
|
|||
};
|
||||
on_attach = mkLuaInline ''
|
||||
function(client, bufnr)
|
||||
default_on_attach(client, bufnr);
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'LspPyrightOrganizeImports', function()
|
||||
local params = {
|
||||
command = 'basedpyright.organizeimports',
|
||||
|
|
|
@ -160,7 +160,6 @@ in {
|
|||
${cfg.lsp.opts}
|
||||
},
|
||||
on_attach = function(client, bufnr)
|
||||
default_on_attach(client, bufnr)
|
||||
local opts = { noremap=true, silent=true, buffer = bufnr }
|
||||
vim.keymap.set("n", "<localleader>rr", ":RustLsp runnables<CR>", opts)
|
||||
vim.keymap.set("n", "<localleader>rp", ":RustLsp parentModule<CR>", opts)
|
||||
|
|
|
@ -50,8 +50,6 @@
|
|||
};
|
||||
on_attach = mkLuaInline ''
|
||||
function(client, bufnr)
|
||||
default_on_attach(client, bufnr);
|
||||
|
||||
-- ts_ls provides `source.*` code actions that apply to the whole file. These only appear in
|
||||
-- `vim.lsp.buf.code_action()` if specified in `context.only`.
|
||||
vim.api.nvim_buf_create_user_command(0, 'LspTypescriptSourceAction', function()
|
||||
|
@ -106,7 +104,6 @@
|
|||
};
|
||||
on_attach = mkLuaInline ''
|
||||
function(client, bufnr)
|
||||
default_on_attach(client, bufnr)
|
||||
vim.api.nvim_buf_create_user_command(0, 'LspDenolsCache', function()
|
||||
client:exec_cmd({
|
||||
command = 'deno.cache',
|
||||
|
|
|
@ -15,18 +15,18 @@
|
|||
|
||||
cfg = config.vim.languages.yaml;
|
||||
|
||||
on_attach = mkLuaInline (
|
||||
on_attach =
|
||||
if config.vim.languages.helm.lsp.enable && config.vim.languages.helm.enable
|
||||
then ''
|
||||
function(client, bufnr)
|
||||
default_on_attach()
|
||||
local filetype = vim.bo[bufnr].filetype
|
||||
if filetype == "helm" then
|
||||
client.stop()
|
||||
then
|
||||
mkLuaInline ''
|
||||
function(client, bufnr)
|
||||
local filetype = vim.bo[bufnr].filetype
|
||||
if filetype == "helm" then
|
||||
client.stop()
|
||||
end
|
||||
end
|
||||
end''
|
||||
else "default_on_attach"
|
||||
);
|
||||
''
|
||||
else null;
|
||||
|
||||
defaultServers = ["yaml-language-server"];
|
||||
servers = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue