modules/lsp: switch to explicit lib calls

This commit is contained in:
raf 2024-03-12 03:46:29 +03:00
commit c488f0490f
No known key found for this signature in database
GPG key ID: 02D1DD3FA08B6B29
33 changed files with 285 additions and 273 deletions

View file

@ -3,8 +3,10 @@
lib,
...
}: let
inherit (lib) mkIf nvim addDescriptionsToMappings mkSetBinding mkMerge;
inherit (builtins) toString;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetBinding;
cfg = config.vim.lsp.nvim-docs-view;
self = import ./nvim-docs-view.nix {inherit lib;};
@ -17,7 +19,7 @@ in {
lsp.enable = true;
startPlugins = ["nvim-docs-view"];
luaConfigRC.nvim-docs-view = nvim.dag.entryAnywhere ''
luaConfigRC.nvim-docs-view = entryAnywhere ''
require("docs-view").setup {
position = "${cfg.position}",
width = ${toString cfg.width},

View file

@ -1,4 +1,4 @@
_: {
{
imports = [
./config.nix
./nvim-docs-view.nix

View file

@ -1,11 +1,13 @@
{lib, ...}: let
inherit (lib) mkEnableOption mkOption types mkMappingOption;
inherit (lib.options) mkEnableOption mkOption;
inherit (lib.types) enum int;
inherit (lib.nvim.binds) mkMappingOption;
in {
options.vim.lsp.nvim-docs-view = {
enable = mkEnableOption "nvim-docs-view, for displaying lsp hover documentation in a side panel.";
position = mkOption {
type = types.enum ["left" "right" "top" "bottom"];
type = enum ["left" "right" "top" "bottom"];
default = "right";
description = ''
Where to open the docs view panel
@ -13,7 +15,7 @@ in {
};
height = mkOption {
type = types.int;
type = int;
default = 10;
description = ''
Height of the docs view panel if the position is set to either top or bottom
@ -21,7 +23,7 @@ in {
};
width = mkOption {
type = types.int;
type = int;
default = 60;
description = ''
Width of the docs view panel if the position is set to either left or right
@ -29,12 +31,14 @@ in {
};
updateMode = mkOption {
type = types.enum ["auto" "manual"];
type = enum ["auto" "manual"];
default = "auto";
description = ''
Determines the mechanism used to update the docs view panel content.
- If auto, the content will update upon cursor move.
- If manual, the content will only update once :DocsViewUpdate is called
Determines the mechanism used to update the docs view panel content
Possible values:
- auto: the content will update upon cursor move.
- manual: the content will only update once :DocsViewUpdate is called
'';
};