Merge branch 'main' into feature/nix-diagnostics

This commit is contained in:
raf 2023-07-31 13:41:27 +03:00 committed by GitHub
commit e35613d004
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 74 additions and 1 deletions

View file

@ -34,9 +34,10 @@ inputs: let
lspkind.enable = false;
lightbulb.enable = true;
lspsaga.enable = false;
nvimCodeActionMenu.enable = true;
nvimCodeActionMenu.enable = isMaximal;
trouble.enable = true;
lspSignature.enable = true;
lsplines.enable = isMaximal;
};
vim.debugger = {

View file

@ -37,3 +37,7 @@ https://github.com/notashelf[notashelf]:
* Fixed mismatching zig language description
* Added support for `statix` and `deadnix` through <<opt-vim.languages.nix.extraDiagnostics.types>>
* Added lsp_lines plugin for showing diagnostic messages
* Added a configuration option for choosing the leader key

View file

@ -613,6 +613,22 @@
"type": "github"
}
},
"lsp-lines": {
"flake": false,
"locked": {
"lastModified": 1684163755,
"narHash": "sha256-Zhf2xitLWtE+dWqhvWtLM1K1WdtBvkqqoRLSYIO42oY=",
"owner": "~whynothugo",
"repo": "lsp_lines.nvim",
"rev": "f53af96d4789eef39a082dbcce078d2bfc384ece",
"type": "sourcehut"
},
"original": {
"owner": "~whynothugo",
"repo": "lsp_lines.nvim",
"type": "sourcehut"
}
},
"lsp-signature": {
"flake": false,
"locked": {
@ -1421,6 +1437,7 @@
"indent-blankline": "indent-blankline",
"kommentary": "kommentary",
"leap-nvim": "leap-nvim",
"lsp-lines": "lsp-lines",
"lsp-signature": "lsp-signature",
"lspkind": "lspkind",
"lspsaga": "lspsaga",

View file

@ -108,6 +108,11 @@
flake = false;
};
lsp-lines = {
url = "sourcehut:~whynothugo/lsp_lines.nvim";
flake = false;
};
null-ls = {
url = "github:jose-elias-alvarez/null-ls.nvim";
flake = false;

View file

@ -90,6 +90,7 @@ with lib; let
"nvim-navic"
"nvim-navbuddy"
"copilot-cmp"
"lsp-lines"
];
# You can either use the name of the plugin or a package.
pluginType = with types;

View file

@ -142,6 +142,9 @@ in {
set spell
set spelllang=${toString cfg.spellChecking.language}
''}
${optionalString (cfg.leaderKey != null) ''
let mapleader = "${toString cfg.leaderKey}"
''}
'';
};
}

View file

@ -31,6 +31,12 @@ with builtins; {
};
};
leaderKey = mkOption {
type = with types; nullOr str;
default = null;
description = "The leader key to be used internally";
};
colourTerm = mkOption {
type = types.bool;
default = true;

View file

@ -15,5 +15,6 @@ _: {
./lsp-signature
./lightbulb
./lspkind
./lsplines
];
}

View file

@ -0,0 +1,20 @@
{
config,
lib,
...
}:
with lib;
with builtins; let
cfg = config.vim.lsp;
in {
config = mkIf (cfg.enable && cfg.lsplines.enable) {
vim.startPlugins = ["lsp-lines"];
vim.luaConfigRC.lsplines = nvim.dag.entryAfter ["lspconfig"] ''
require("lsp_lines").setup()
vim.diagnostic.config({
virtual_text = false,
})
'';
};
}

View file

@ -0,0 +1,6 @@
_: {
imports = [
./config.nix
./lsplines.nix
];
}

View file

@ -0,0 +1,9 @@
{lib, ...}:
with lib;
with builtins; {
options.vim.lsp = {
lsplines = {
enable = mkEnableOption "diagnostics using virtual lines on top of the real line of code. [lsp_lines]";
};
};
}