forked from nix-community/nixvim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plugins/haskell-scope-highlighting: init + test
Add warning for Treesitter dependency Co-authored-by: Gaétan Lepage <33058747+GaetanLepage@users.noreply.github.com> add test for highlights, add package tweak warning message enable treesitter in tests suggested change
- Loading branch information
1 parent
43f3cb7
commit 3958364
Showing
3 changed files
with
51 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
lib, | ||
pkgs, | ||
helpers, | ||
config, | ||
... | ||
}: | ||
with lib; let | ||
cfg = config.plugins.haskell-scope-highlighting; | ||
in { | ||
options.plugins.haskell-scope-highlighting = { | ||
enable = mkEnableOption "haskell-scope-highlighting"; | ||
|
||
package = helpers.mkPackageOption "haskell-scope-highlighting" pkgs.vimPlugins.haskell-scope-highlighting-nvim; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
warnings = optional (!config.plugins.treesitter.enable) '' | ||
Nixvim (plugins.haskell-scope-highlighting): haskell-scope-highlighting needs treesitter to function as intended. Please, enable it by setting `plugins.treesitter.enable` to `true`. | ||
''; | ||
|
||
extraPlugins = [cfg.package]; | ||
}; | ||
} |
24 changes: 24 additions & 0 deletions
24
tests/test-sources/plugins/languages/haskell-scope-highlighting.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,24 @@ | ||
{ | ||
empty = { | ||
plugins.haskell-scope-highlighting.enable = true; | ||
plugins.treesitter.enable = true; | ||
}; | ||
|
||
testHaskellHighlights = { | ||
plugins.haskell-scope-highlighting.enable = true; | ||
plugins.treesitter.enable = true; | ||
highlight = { | ||
HaskellCurrentScope.bg = "black"; | ||
HaskellParentScope1.bg = "black"; | ||
HaskellParentScope2.bg = "black"; | ||
HaskellParentScope3.bg = "black"; | ||
HaskellVariableDeclarationWithinScope.bg = "black"; | ||
HaskellVariableDeclaredWithinFile.bg = "black"; | ||
HaskellVariableDeclaredWithinParent1.bg = "black"; | ||
HaskellVariableDeclaredWithinParent2.bg = "black"; | ||
HaskellVariableDeclaredWithinParent3.bg = "black"; | ||
HaskellVariableDeclaredWithinScope.bg = "black"; | ||
HaskellVariableNotDeclaredWithinFile.bg = "black"; | ||
}; | ||
}; | ||
} |