mirror of
https://github.com/nix-community/nixvim.git
synced 2026-08-24 10:14:03 -05:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user