-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #174 from NotAShelf/nvim-docs-view
modules/lsp: add nvim-docs-view
- Loading branch information
Showing
9 changed files
with
112 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,6 @@ _: { | |
./lightbulb | ||
./lspkind | ||
./lsplines | ||
./nvim-docs-view | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
config, | ||
lib, | ||
... | ||
}: let | ||
inherit (lib) mkIf nvim; | ||
inherit (builtins) toString; | ||
|
||
cfg = config.vim.lsp.nvim-docs-view; | ||
in { | ||
config = mkIf cfg.enable { | ||
vim = { | ||
lsp.enable = true; | ||
startPlugins = ["nvim-docs-view"]; | ||
|
||
luaConfigRC.nvim-docs-view = nvim.dag.entryAnywhere '' | ||
require("docs-view").setup { | ||
position = "${cfg.position}", | ||
width = ${toString cfg.width}, | ||
height = ${toString cfg.height}, | ||
update_mode = "${cfg.updateMode}", | ||
} | ||
''; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
_: { | ||
imports = [ | ||
./config.nix | ||
./nvim-docs-view.nix | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{lib, ...}: let | ||
inherit (lib) mkEnableOption mkOption types; | ||
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"]; | ||
default = "right"; | ||
description = '' | ||
Where to open the docs view panel | ||
''; | ||
}; | ||
|
||
height = mkOption { | ||
type = types.int; | ||
default = 10; | ||
description = '' | ||
Height of the docs view panel if the position is set to either top or bottom | ||
''; | ||
}; | ||
|
||
width = mkOption { | ||
type = types.int; | ||
default = 60; | ||
description = '' | ||
Width of the docs view panel if the position is set to either left or right | ||
''; | ||
}; | ||
|
||
updateMode = mkOption { | ||
type = types.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 | ||
''; | ||
}; | ||
}; | ||
} |