mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-10 23:13:17 +00:00
Merge branch 'main' into feat/rustaceanvim
This commit is contained in:
commit
72d36ba94e
9 changed files with 311 additions and 103 deletions
|
|
@ -1,11 +1,40 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
in {
|
||||
options.vim.lsp = {
|
||||
lspSignature = {
|
||||
enable = mkEnableOption "lsp signature viewer";
|
||||
setupOpts = mkPluginSetupOption "lsp-signature" {};
|
||||
setupOpts = mkPluginSetupOption "lsp-signature" {
|
||||
ignore_error = mkOption {
|
||||
type = luaInline;
|
||||
description = "Custom error filter.";
|
||||
# https://github.com/NotAShelf/nvf/pull/1545#discussion_r3253920092
|
||||
defaultText = "Filters out errors that occur more than once, per client";
|
||||
default = mkLuaInline ''
|
||||
function(err, ctx, config)
|
||||
if ctx and ctx.client_id then
|
||||
-- upstream default
|
||||
local client = vim.lsp.get_client_by_id(ctx.client_id)
|
||||
if client and vim.tbl_contains({"rust-analyzer", "clangd"}, client.name) then
|
||||
return true
|
||||
end
|
||||
|
||||
-- prevents error spam
|
||||
_LSP_SIG_IGNORE_ERR = _LSP_SIG_IGNORE_ERR or {}
|
||||
_LSP_SIG_IGNORE_ERR[ctx.client_id] = _LSP_SIG_IGNORE_ERR[ctx.client_id]
|
||||
or {}
|
||||
if _LSP_SIG_IGNORE_ERR[ctx.client_id][err.code] then
|
||||
return true
|
||||
end
|
||||
|
||||
_LSP_SIG_IGNORE_ERR[ctx.client_id][err.code] = true
|
||||
end
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
./gopls.nix
|
||||
./harper.nix
|
||||
./helm-ls.nix
|
||||
./haskell-language-server.nix
|
||||
./intelephense.nix
|
||||
./jdt-language-server.nix
|
||||
./jinja-lsp.nix
|
||||
|
|
@ -47,6 +48,7 @@
|
|||
./openscad-lsp.nix
|
||||
./phan.nix
|
||||
./phpactor.nix
|
||||
./phpantom.nix
|
||||
./pyrefly.nix
|
||||
./pyright.nix
|
||||
./python-lsp-server.nix
|
||||
|
|
|
|||
37
modules/plugins/lsp/presets/haskell-language-server.nix
Normal file
37
modules/plugins/lsp/presets/haskell-language-server.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe';
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkLspPresetEnableOption;
|
||||
|
||||
cfg = config.vim.lsp.presets.haskell-language-server;
|
||||
in {
|
||||
options.vim.lsp.presets.haskell-language-server = {
|
||||
enable = mkLspPresetEnableOption "haskell-language-server" "Haskell" [];
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.lsp.servers.haskell-language-server = {
|
||||
enable = true;
|
||||
cmd = [
|
||||
(getExe' (pkgs.symlinkJoin {
|
||||
name = "haskell-language-server-wrapper";
|
||||
paths = [pkgs.haskellPackages.haskell-language-server];
|
||||
meta.mainProgram = "haskell-language-server-wrapper";
|
||||
buildInputs = [pkgs.makeBinaryWrapper];
|
||||
# wrap HLS-wrapper so it can find the actual binary
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/haskell-language-server-wrapper \
|
||||
--prefix PATH : ${pkgs.haskellPackages.haskell-language-server}/bin
|
||||
'';
|
||||
}) "haskell-language-server-wrapper")
|
||||
"--lsp"
|
||||
];
|
||||
root_markers = ["hie.yaml" "stack.yaml" "cabal.project" "*.cabal" "package.yaml"];
|
||||
};
|
||||
};
|
||||
}
|
||||
24
modules/plugins/lsp/presets/phpantom.nix
Normal file
24
modules/plugins/lsp/presets/phpantom.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.types) mkLspPresetEnableOption;
|
||||
|
||||
cfg = config.vim.lsp.presets.phpantom;
|
||||
in {
|
||||
options.vim.lsp.presets.phpantom = {
|
||||
enable = mkLspPresetEnableOption "phpantom" "PHPantom" [];
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
vim.lsp.servers.phpantom = {
|
||||
enable = true;
|
||||
cmd = [(getExe pkgs.phpantom)];
|
||||
root_markers = [".phpantom.toml" "composer.json" ".php-version" ".git"];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue