1
0
Fork 0

nvim diagnostic/LSP config updates

This commit is contained in:
Daniel Kempkens 2021-12-20 18:43:23 +01:00
parent 25b234ff8a
commit 957d89f177
6 changed files with 41 additions and 38 deletions

View file

@ -1,7 +1,7 @@
vim.diagnostic.config({ vim.diagnostic.config({
underline = true, underline = true,
virtual_text = { virtual_text = {
source = 'if_many', source = false,
}, },
signs = false, signs = false,
update_in_insert = false, update_in_insert = false,

View file

@ -9,7 +9,6 @@ null_ls.setup({
builtins.formatting.fish_indent, builtins.formatting.fish_indent,
builtins.formatting.shfmt.with({extra_args = { '-i', '2' }}), builtins.formatting.shfmt.with({extra_args = { '-i', '2' }}),
builtins.diagnostics.ansiblelint,
builtins.diagnostics.credo, builtins.diagnostics.credo,
builtins.diagnostics.hadolint, builtins.diagnostics.hadolint,
builtins.diagnostics.shellcheck.with({extra_args = { '-f', 'gcc', '-x' }}), builtins.diagnostics.shellcheck.with({extra_args = { '-f', 'gcc', '-x' }}),

View file

@ -3,7 +3,9 @@ local M = {}
local keymap = require('nifoc.keymap') local keymap = require('nifoc.keymap')
function M.maybe_enable_lsp(client, bufnr) function M.maybe_enable_lsp(client, bufnr)
if vim.b.nifoc_lsp_enabled == nil then local nifoc_lsp_enabled = vim.api.nvim_buf_get_var(bufnr, 'nifoc_lsp_enabled')
if nifoc_lsp_enabled == nil then
vim.api.nvim_buf_set_var(bufnr, 'nifoc_lsp_enabled', 1) vim.api.nvim_buf_set_var(bufnr, 'nifoc_lsp_enabled', 1)
keymap.lsp_attach(client, bufnr) keymap.lsp_attach(client, bufnr)
@ -11,7 +13,9 @@ function M.maybe_enable_lsp(client, bufnr)
end end
function M.maybe_enable_fixer(client, bufnr) function M.maybe_enable_fixer(client, bufnr)
if client.resolved_capabilities.document_formatting and vim.b.nifoc_fixer_enabled == nil then local nifoc_fixer_enabled = vim.api.nvim_buf_get_var(bufnr, 'nifoc_fixer_enabled')
if client.resolved_capabilities.document_formatting and nifoc_fixer_enabled == nil then
vim.api.nvim_buf_set_var(bufnr, 'nifoc_fixer_enabled', 1) vim.api.nvim_buf_set_var(bufnr, 'nifoc_fixer_enabled', 1)
vim.cmd [[ vim.cmd [[

View file

@ -61,11 +61,11 @@
}, },
"locked": { "locked": {
"dir": "contrib", "dir": "contrib",
"lastModified": 1639886342, "lastModified": 1639947653,
"narHash": "sha256-OkI09enAc4ID1zrxLkHR5b+WgUL2r2C9BIG4+gwVDFU=", "narHash": "sha256-odG+fhjB0OavINI9ELUPhBHUmKQ+lqlSkcmHdgFbhTY=",
"owner": "neovim", "owner": "neovim",
"repo": "neovim", "repo": "neovim",
"rev": "abdf3a8128b78fb98ee944bc5d3086c680d779ed", "rev": "67bb01ae27db3cbba9e2e908c4e6612040f650aa",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -84,11 +84,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1639901638, "lastModified": 1639988082,
"narHash": "sha256-ZMP2xjjo3tHlWfgCd3Odn6qKNpNbvbawjcVpww54A1U=", "narHash": "sha256-9YPZgGP/C9AKLxSYmw9R8tn64bZ0WM2OYIui+2PLwPw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "neovim-nightly-overlay", "repo": "neovim-nightly-overlay",
"rev": "8f7a0bbc9080f55c000344658a071994aa9c6b4b", "rev": "116189ff27ac056faa8ec3f7ecc6dc3f6f565b67",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -119,11 +119,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1639925673, "lastModified": 1639955162,
"narHash": "sha256-hR/d0JcT11z6Bi69ipowMtvRye7OymVfDw1/wwVBWnc=", "narHash": "sha256-bRhzK0h4n1YirCsJz7pkpXXy2+ruth/bUh7PwRrRnW4=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c62eb9c6aea5ae8210dd86ff24fa6b51f8872db7", "rev": "2beba9a23a8381eb95187f46b10c3677d8f63ca1",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -24,6 +24,7 @@ in
# LSP # LSP
nodePackages.bash-language-server nodePackages.bash-language-server
nodePackages.dockerfile-language-server-nodejs nodePackages.dockerfile-language-server-nodejs
nodePackages.typescript-language-server
nodePackages.vscode-langservers-extracted nodePackages.vscode-langservers-extracted
nodePackages.yaml-language-server nodePackages.yaml-language-server
rnix-lsp rnix-lsp
@ -31,7 +32,6 @@ in
taplo-lsp taplo-lsp
# LSP Tools # LSP Tools
ansible-lint
hadolint hadolint
shellcheck shellcheck
shfmt shfmt

View file

@ -99,12 +99,12 @@
}; };
nvim-treesitter = pkgs.vimUtils.buildVimPluginFrom2Nix { nvim-treesitter = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nvim-treesitter"; pname = "nvim-treesitter";
version = "1639864170"; version = "1639992650";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "nvim-treesitter"; owner = "nvim-treesitter";
repo = "nvim-treesitter"; repo = "nvim-treesitter";
rev = "e01c7ce9727b9d18b71b41cc792cb4719e469598"; rev = "2752160771c679a7d92a4664de133d7750ab5448";
sha256 = "I9+GPTRkKaT8MN9Vqeif6SG3NqzUA7qvKxcYWVsSHKY="; sha256 = "LXxYT9QCkm0lKDyTPJwswZ5c0IpcIGMxhauVH/ESNiY=";
fetchSubmodules = false; fetchSubmodules = false;
}; };
meta.homepage = "https://github.com/nvim-treesitter/nvim-treesitter"; meta.homepage = "https://github.com/nvim-treesitter/nvim-treesitter";
@ -196,12 +196,12 @@
}; };
nvim-lspconfig = pkgs.vimUtils.buildVimPluginFrom2Nix { nvim-lspconfig = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nvim-lspconfig"; pname = "nvim-lspconfig";
version = "1639765938"; version = "1639958794";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "neovim"; owner = "neovim";
repo = "nvim-lspconfig"; repo = "nvim-lspconfig";
rev = "0f72e5468e510429d5f14b73c93fb528ead1fdaa"; rev = "c018b1e92e66b3429a2f167d59211846774f1e3b";
sha256 = "XUNahLXiDk8iJEUAyKj/Ru8N0NUIX+1xWY0obOFTT40="; sha256 = "CRa1Z4LaDuvIwmwsKIypt6w+GZbFfi0JDEYQoHxl+Rc=";
fetchSubmodules = false; fetchSubmodules = false;
}; };
meta.homepage = "https://github.com/neovim/nvim-lspconfig"; meta.homepage = "https://github.com/neovim/nvim-lspconfig";
@ -268,12 +268,12 @@
}; };
nvim-cmp = pkgs.vimUtils.buildVimPluginFrom2Nix { nvim-cmp = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nvim-cmp"; pname = "nvim-cmp";
version = "1639842196"; version = "1639979656";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "hrsh7th"; owner = "hrsh7th";
repo = "nvim-cmp"; repo = "nvim-cmp";
rev = "b11f8bbee3d7ba5190b043e23bd6f5b9cb82382c"; rev = "9c07c2d1c5581b22f742b891cadd42a311c1cf96";
sha256 = "xiC5cCUE18S5M2rxDXCTwLV5ZmCy6Z7lDzur53xVAQ0="; sha256 = "iiAwGu9dJ249IOYKNJmwEofaicw8jDtcmTSKr4o4g8Y=";
fetchSubmodules = false; fetchSubmodules = false;
}; };
meta.homepage = "https://github.com/hrsh7th/nvim-cmp"; meta.homepage = "https://github.com/hrsh7th/nvim-cmp";
@ -340,24 +340,24 @@
}; };
cmp-path = pkgs.vimUtils.buildVimPluginFrom2Nix { cmp-path = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "cmp-path"; pname = "cmp-path";
version = "1639837442"; version = "1639986819";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "hrsh7th"; owner = "hrsh7th";
repo = "cmp-path"; repo = "cmp-path";
rev = "e1a69161703171f5804d311005a73b742fbda123"; rev = "81d88dfcafe26cc0cc856fc66f4677b20e6a9ffc";
sha256 = "wdARGRz1TU/Igb2J49lB2zp/+gFEnTQFipMZOM2A81o="; sha256 = "h7/0UNmYSsFIiU4eBMDOqujsuo61CPvC2nv1pfbnA7c=";
fetchSubmodules = false; fetchSubmodules = false;
}; };
meta.homepage = "https://github.com/hrsh7th/cmp-path"; meta.homepage = "https://github.com/hrsh7th/cmp-path";
}; };
cmp-buffer = pkgs.vimUtils.buildVimPluginFrom2Nix { cmp-buffer = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "cmp-buffer"; pname = "cmp-buffer";
version = "1638920207"; version = "1639956440";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "hrsh7th"; owner = "hrsh7th";
repo = "cmp-buffer"; repo = "cmp-buffer";
rev = "a0fe52489ff6e235d62407f8fa72aef80222040a"; rev = "e26cdfb26f645cd4c6330b541b7e74ff69daa483";
sha256 = "FYAb3Wv9wbaxvv7PXi4ko4mqmsRo2V7yM42Ci+3ST0w="; sha256 = "YjO4zGm7TKZZv0mMsh9oM2wC+FKoq38bSmfZ3XqXWlc=";
fetchSubmodules = false; fetchSubmodules = false;
}; };
meta.homepage = "https://github.com/hrsh7th/cmp-buffer"; meta.homepage = "https://github.com/hrsh7th/cmp-buffer";
@ -412,36 +412,36 @@
}; };
nvim-ts-autotag = pkgs.vimUtils.buildVimPluginFrom2Nix { nvim-ts-autotag = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nvim-ts-autotag"; pname = "nvim-ts-autotag";
version = "1633755976"; version = "1639950366";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "windwp"; owner = "windwp";
repo = "nvim-ts-autotag"; repo = "nvim-ts-autotag";
rev = "80d427af7b898768c8d8538663d52dee133da86f"; rev = "0ceb4ef342bf1fdbb082ad4fa1fcfd0f864e1cba";
sha256 = "8SINCRoarkkQdrKzq4xujn197G4BRHQ7HYJQj929nME="; sha256 = "5410HeSpgID+Nf/5Yowxgw9yUl9nkI+EM5sD+6yEci0=";
fetchSubmodules = false; fetchSubmodules = false;
}; };
meta.homepage = "https://github.com/windwp/nvim-ts-autotag"; meta.homepage = "https://github.com/windwp/nvim-ts-autotag";
}; };
Comment-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix { Comment-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "Comment.nvim"; pname = "Comment.nvim";
version = "1639729979"; version = "1639986940";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "numToStr"; owner = "numToStr";
repo = "Comment.nvim"; repo = "Comment.nvim";
rev = "cedca3967c25c1755992044b8d0e7917fb98d2ff"; rev = "b7e18f9477974044b8ba3de93b51cad804a37eed";
sha256 = "0YOiRHgxcwXHLQxErx3g5O8hiBsXKmnfXBnl5M8eJ7g="; sha256 = "7dfU1Ei1kMBHV2dp4URd+wNrf699CqFq5ZvLWT7mQjU=";
fetchSubmodules = false; fetchSubmodules = false;
}; };
meta.homepage = "https://github.com/numToStr/Comment.nvim"; meta.homepage = "https://github.com/numToStr/Comment.nvim";
}; };
nvim-treesitter-textobjects = pkgs.vimUtils.buildVimPluginFrom2Nix { nvim-treesitter-textobjects = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nvim-treesitter-textobjects"; pname = "nvim-treesitter-textobjects";
version = "1639943238"; version = "1639954216";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "nvim-treesitter"; owner = "nvim-treesitter";
repo = "nvim-treesitter-textobjects"; repo = "nvim-treesitter-textobjects";
rev = "c4be3a42715dd44ea9465662ad7e3b010f6acf47"; rev = "a9b7d9beeaae07e87aeb78765cfa53e1c5eae1f6";
sha256 = "xz9H8vb4fHBmpeLeUqluP1jS0DnIIhaafIV+NLE1WWY="; sha256 = "WSBs8Kj4LF89Fe/SMKtTeQD5jck4v6vck3Imx2xCF0c=";
fetchSubmodules = false; fetchSubmodules = false;
}; };
meta.homepage = "https://github.com/nvim-treesitter/nvim-treesitter-textobjects"; meta.homepage = "https://github.com/nvim-treesitter/nvim-treesitter-textobjects";