plugins/otter: use option interpolation in warning
Stringifying actual options via `"${option}"` interpolation ensures the
full option path (with prefix) is used.
This commit is contained in:
parent
4a6d561362
commit
db0fa29513
2 changed files with 11 additions and 4 deletions
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
options,
|
||||
...
|
||||
}:
|
||||
lib.nixvim.plugins.mkNeovimPlugin {
|
||||
|
|
@ -89,10 +90,14 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
in
|
||||
!(treesitter.enable && highlightEnabled);
|
||||
|
||||
message = ''
|
||||
You have enabled otter, but treesitter syntax highlighting is not enabled.
|
||||
Otter functionality might not work as expected without it. Make sure `plugins.treesitter.highlight.enable` and `plugins.treesitter.enable` are enabled.
|
||||
'';
|
||||
message =
|
||||
let
|
||||
inherit (options.plugins) treesitter;
|
||||
in
|
||||
''
|
||||
You have enabled otter, but treesitter syntax highlighting is not enabled.
|
||||
Otter functionality might not work as expected without it. Make sure `${treesitter.highlight.enable}` and `${treesitter.enable}` are enabled.
|
||||
'';
|
||||
};
|
||||
|
||||
lsp.onAttach = lib.mkIf cfg.autoActivate ''
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@
|
|||
test.warnings = expect: [
|
||||
(expect "count" 1)
|
||||
(expect "any" "You have enabled otter, but treesitter syntax highlighting is not enabled.")
|
||||
(expect "any" "Make sure `plugins.treesitter.highlight.enable` and `plugins.treesitter.enable` are enabled.")
|
||||
];
|
||||
plugins = {
|
||||
otter.enable = true;
|
||||
|
|
@ -79,6 +80,7 @@
|
|||
test.warnings = expect: [
|
||||
(expect "count" 1)
|
||||
(expect "any" "You have enabled otter, but treesitter syntax highlighting is not enabled.")
|
||||
(expect "any" "Make sure `plugins.treesitter.highlight.enable` and `plugins.treesitter.enable` are enabled.")
|
||||
];
|
||||
plugins = {
|
||||
otter.enable = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue