1
0
Fork 0

nvim: Enable native codelens

This commit is contained in:
Daniel Kempkens 2022-04-22 14:19:36 +02:00
parent 1dac376e82
commit 073212b173
6 changed files with 40 additions and 48 deletions

View file

@ -18,9 +18,17 @@
(when (= vim.b.nifoc_lsp_enabled nil) (when (= vim.b.nifoc_lsp_enabled nil)
(api.nvim_buf_set_var bufnr :nifoc_lsp_enabled 1) (api.nvim_buf_set_var bufnr :nifoc_lsp_enabled 1)
(keymap.lsp-attach client bufnr) (keymap.lsp-attach client bufnr)
(api.nvim_create_autocmd [:CursorHold :CursorHoldI] (let [augroup (vim.api.nvim_create_augroup :NifocDiagnostic {:clear true})
{:callback #(vim.diagnostic.open_float nil aucmd vim.api.nvim_create_autocmd]
{:focus false}) (aucmd [:CursorHold :CursorHoldI]
:buffer bufnr}))) {:callback (fn []
(vim.diagnostic.open_float nil {:focus false})
(vim.lsp.codelens.refresh))
:buffer bufnr
:group augroup})
(aucmd :InsertLeave {:callback #(vim.lsp.codelens.refresh)
:buffer bufnr
:group augroup}))))
mod) mod)

View file

@ -1,7 +1,6 @@
(let [lsp (require :lspconfig) (let [lsp (require :lspconfig)
lsp-status (require :lsp-status) lsp-status (require :lsp-status)
illuminate (require :illuminate) illuminate (require :illuminate)
virtual-types (require :virtualtypes)
cmp (require :cmp_nvim_lsp) cmp (require :cmp_nvim_lsp)
diagnostic (require :nifoc.diagnostic) diagnostic (require :nifoc.diagnostic)
formatting (require :nifoc.formatting)] formatting (require :nifoc.formatting)]
@ -10,8 +9,6 @@
(lsp-status.on_attach client bufnr)) (lsp-status.on_attach client bufnr))
(when client.server_capabilities.documentHighlightProvider (when client.server_capabilities.documentHighlightProvider
(illuminate.on_attach client bufnr)) (illuminate.on_attach client bufnr))
(when client.server_capabilities.codeLensProvider
(virtual-types.on_attach client bufnr))
(diagnostic.maybe-enable-lsp client bufnr) (diagnostic.maybe-enable-lsp client bufnr)
(formatting.maybe-enable-lsp client bufnr)) (formatting.maybe-enable-lsp client bufnr))
@ -76,3 +73,4 @@
:diagnostics {:globals [:vim]} :diagnostics {:globals [:vim]}
:telemetry {:enable false}}}} :telemetry {:enable false}}}}
(vim.tbl_extend :force default-config))))) (vim.tbl_extend :force default-config)))))

View file

@ -96,11 +96,11 @@
}, },
"locked": { "locked": {
"dir": "contrib", "dir": "contrib",
"lastModified": 1650499578, "lastModified": 1650570367,
"narHash": "sha256-iJLetvUtr+NweIt3nbY8zO3NR70cyFBVUHYGViWSosI=", "narHash": "sha256-eCsF9CoqEXSECL5iFND11zBuYcd5DYdT1JnQZpQGFYI=",
"owner": "neovim", "owner": "neovim",
"repo": "neovim", "repo": "neovim",
"rev": "db851cb105ac9f295a836a39ff73da14a70ae754", "rev": "6c8a3013ac8cbcbfc8b3e1d51f6491bfa0c4a7aa",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -119,11 +119,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1650529029, "lastModified": 1650615499,
"narHash": "sha256-/BZThOlIN+Q/YgK2jf5k7l37XiHTnqD318sQpRu0/kU=", "narHash": "sha256-LVG9E/mDHCeBoAcvC8zV68FnfdI5GWFwWyFu86iagq8=",
"owner": "nix-community", "owner": "nix-community",
"repo": "neovim-nightly-overlay", "repo": "neovim-nightly-overlay",
"rev": "edf6d999c74bf9772afd7c027e0d0a73bf033b4a", "rev": "245a28697c7cfc18606c50f0d4f5baedd1dd59ea",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -154,11 +154,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1650527056, "lastModified": 1650585041,
"narHash": "sha256-dyBthjAs6JlNNDMi7SY+d2CirgBDqjG8SvZKeUvTLqM=", "narHash": "sha256-wZAZbkHwXKKdFTrDdKiFIvAtYOgQd3qO1jSSsaWlU84=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b06d35b406c2396dd1611dc8601138fa3d06ee60", "rev": "f53f90b66921488fb3681ac78528ce407b775590",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -186,11 +186,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1650501834, "lastModified": 1650588250,
"narHash": "sha256-ZBM6+zU/H5QfdB6W8x+wn1a4heAi4P2MtzbRcH3zXZA=", "narHash": "sha256-RvfHbRbZ7FcwCtdUrhpghaNdk5oUqs1MEEUdfifIkFI=",
"owner": "arqv", "owner": "arqv",
"repo": "zig-overlay", "repo": "zig-overlay",
"rev": "fa32b66e4de51b3cd4018d50e8356ec3f0c1cf6b", "rev": "79ad5ae65cab7033b9483fb53329ffd1be375484",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -131,8 +131,6 @@ in
type = "fennel"; type = "fennel";
} }
virtual-types-nvim
# Linter # Linter
{ {
plugin = nvim-lint; plugin = nvim-lint;

View file

@ -47,12 +47,12 @@
}; };
yanky-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix { yanky-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "yanky.nvim"; pname = "yanky.nvim";
version = "2022-04-06"; version = "2022-04-22";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "gbprod"; owner = "gbprod";
repo = "yanky.nvim"; repo = "yanky.nvim";
rev = "1c96ef6d44f6d2a8a034f4eb242ddaa015674d1c"; rev = "0155028360e3072fd4f49b58a0d35c6b45c9e64f";
sha256 = "11bgjkr9kmx19j9waamlphf81k3spk672smbqirrnnwc0w4lvn3c"; sha256 = "11gi69allx6v3c5szv3s98ism8xkir0p4dzpx0wmwyhl5bkafp36";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };
@ -102,12 +102,12 @@
}; };
nvim-treesitter = pkgs.vimUtils.buildVimPluginFrom2Nix { nvim-treesitter = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nvim-treesitter"; pname = "nvim-treesitter";
version = "2022-04-21"; version = "2022-04-22";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "nvim-treesitter"; owner = "nvim-treesitter";
repo = "nvim-treesitter"; repo = "nvim-treesitter";
rev = "bd2f5d770d0a98b1d89bb95dab7ca396b01ce1fe"; rev = "3c50297eca950b4b1a7c07b28e586b0576c0a796";
sha256 = "0prs6b4r4bsy6799dwx4drxp2iakwj8cv5qbzgny2fis6zkrz5gf"; sha256 = "1jkrd5z85hsqg05br39pyv7sjpn2g3warg70s5arm0xxppc5m9pc";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };
@ -195,17 +195,6 @@
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };
virtual-types-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "virtual-types.nvim";
version = "2022-03-17";
src = pkgs.fetchFromGitHub {
owner = "jubnzv";
repo = "virtual-types.nvim";
rev = "31da847fa54b801f309a08123935626adda4aaad";
sha256 = "0kqg29xld064fz1xly1kc7wcyck62q5hjkb5fc5vrj0zdnrdzz22";
fetchSubmodules = false;
};
};
nvim-lint = pkgs.vimUtils.buildVimPluginFrom2Nix { nvim-lint = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nvim-lint"; pname = "nvim-lint";
version = "2022-04-18"; version = "2022-04-18";
@ -340,23 +329,23 @@
}; };
nvim-autopairs = pkgs.vimUtils.buildVimPluginFrom2Nix { nvim-autopairs = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nvim-autopairs"; pname = "nvim-autopairs";
version = "2022-04-14"; version = "2022-04-22";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "windwp"; owner = "windwp";
repo = "nvim-autopairs"; repo = "nvim-autopairs";
rev = "38d486a1c47ae2722a78cf569008de0a64f4b153"; rev = "e9b47f0f681f94cedd8af671b363dd2497a22c5c";
sha256 = "0qka37c8ikcqvbjq0n0kxgm8l30jy3aixs5i00a25wcwxj40kzxv"; sha256 = "09hbgb233szzbjmrdmkz9znxa6wpi3n06zvq2g7kqzisz87fd8bw";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };
nvim-ts-autotag = pkgs.vimUtils.buildVimPluginFrom2Nix { nvim-ts-autotag = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nvim-ts-autotag"; pname = "nvim-ts-autotag";
version = "2022-03-04"; version = "2022-04-22";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "windwp"; owner = "windwp";
repo = "nvim-ts-autotag"; repo = "nvim-ts-autotag";
rev = "57035b5814f343bc6110676c9ae2eacfcd5340c2"; rev = "044a05c4c51051326900a53ba98fddacd15fea22";
sha256 = "06fj3bpfakbzbb4saqa2dss0wz6z98farljv3xmih162qbybr2c1"; sha256 = "0c94vnhl216p36x19cplhypr1b3z0f7l5jdr19hl79qvdfp9djk2";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };
@ -439,12 +428,12 @@
}; };
gitsigns-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix { gitsigns-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "gitsigns.nvim"; pname = "gitsigns.nvim";
version = "2022-04-20"; version = "2022-04-22";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "lewis6991"; owner = "lewis6991";
repo = "gitsigns.nvim"; repo = "gitsigns.nvim";
rev = "f83a2e11cd7a486e92f3c6630e71e93a073a11da"; rev = "f2243468ee14f69df48e7de61f866889df8b17a7";
sha256 = "05lpq5v6ss3wdk6m5pj9llgq31490khfscvrmcyi3cv48kqzhchi"; sha256 = "0lfbgwnc8i4q2qymswja9d4mwlgzzvrzzy5vwpjk4r4zzps7lrw3";
fetchSubmodules = false; fetchSubmodules = false;
}; };
}; };

View file

@ -37,7 +37,6 @@
# LSP # LSP
- src: neovim/nvim-lspconfig - src: neovim/nvim-lspconfig
- src: jubnzv/virtual-types.nvim
# Linter # Linter
- src: mfussenegger/nvim-lint - src: mfussenegger/nvim-lint