mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 10:21:31 +00:00
languages/glsl: init
This commit is contained in:
parent
be41631a84
commit
4a1fc26099
3 changed files with 66 additions and 0 deletions
|
@ -394,12 +394,14 @@
|
||||||
[oil-git-status]: https://github.com/refractalize/oil-git-status.nvim
|
[oil-git-status]: https://github.com/refractalize/oil-git-status.nvim
|
||||||
[neocmakelsp]: https://github.com/neocmakelsp/neocmakelsp
|
[neocmakelsp]: https://github.com/neocmakelsp/neocmakelsp
|
||||||
[arduino-language-server]: https://github.com/arduino/arduino-language-server
|
[arduino-language-server]: https://github.com/arduino/arduino-language-server
|
||||||
|
[glsl_analyzer]: https://github.com/nolanderc/glsl_analyzer
|
||||||
|
|
||||||
- Fix gitsigns null-ls issue.
|
- Fix gitsigns null-ls issue.
|
||||||
- Add [everforest] theme support.
|
- Add [everforest] theme support.
|
||||||
- Add [oil-git-status] support to [oil] module.
|
- Add [oil-git-status] support to [oil] module.
|
||||||
- Add CMake support with [neocmakelsp].
|
- Add CMake support with [neocmakelsp].
|
||||||
- Add Arduino support with [arduino-language-server].
|
- Add Arduino support with [arduino-language-server].
|
||||||
|
- Add GLSL support with [glsl_analyzer].
|
||||||
|
|
||||||
[Haskex](https://github.com/haskex):
|
[Haskex](https://github.com/haskex):
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ in {
|
||||||
./elixir.nix
|
./elixir.nix
|
||||||
./fsharp.nix
|
./fsharp.nix
|
||||||
./gleam.nix
|
./gleam.nix
|
||||||
|
./glsl.nix
|
||||||
./go.nix
|
./go.nix
|
||||||
./hcl.nix
|
./hcl.nix
|
||||||
./helm.nix
|
./helm.nix
|
||||||
|
|
63
modules/plugins/languages/glsl.nix
Normal file
63
modules/plugins/languages/glsl.nix
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (builtins) attrNames;
|
||||||
|
inherit (lib.modules) mkIf mkMerge;
|
||||||
|
inherit (lib.nvim.types) mkGrammarOption;
|
||||||
|
inherit (lib.options) mkEnableOption mkOption;
|
||||||
|
inherit (lib.types) enum listOf;
|
||||||
|
inherit (lib.meta) getExe;
|
||||||
|
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||||
|
|
||||||
|
cfg = config.vim.languages.glsl;
|
||||||
|
|
||||||
|
defaultServers = ["glsl_analyzer"];
|
||||||
|
servers = {
|
||||||
|
glsl_analyzer = {
|
||||||
|
enable = true;
|
||||||
|
cmd = [(getExe pkgs.glsl_analyzer)];
|
||||||
|
filetypes = ["glsl" "vert" "tesc" "tese" "frag" "geom" "comp"];
|
||||||
|
root_markers = [".git"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
options.vim.languages.glsl = {
|
||||||
|
enable = mkEnableOption "GLSL language support";
|
||||||
|
|
||||||
|
treesitter = {
|
||||||
|
enable = mkEnableOption "GLSL treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||||
|
package = mkGrammarOption pkgs "glsl";
|
||||||
|
};
|
||||||
|
|
||||||
|
lsp = {
|
||||||
|
enable = mkEnableOption "GLSL LSP support" // {default = config.vim.lsp.enable;};
|
||||||
|
|
||||||
|
servers = mkOption {
|
||||||
|
type = listOf (enum (attrNames servers));
|
||||||
|
default = defaultServers;
|
||||||
|
description = "GLSL LSP server to use";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable (mkMerge [
|
||||||
|
(mkIf cfg.treesitter.enable {
|
||||||
|
vim.treesitter = {
|
||||||
|
enable = true;
|
||||||
|
grammars = [cfg.treesitter.package];
|
||||||
|
};
|
||||||
|
})
|
||||||
|
|
||||||
|
(mkIf cfg.lsp.enable {
|
||||||
|
vim.lsp.servers =
|
||||||
|
mapListToAttrs (n: {
|
||||||
|
name = n;
|
||||||
|
value = servers.${n};
|
||||||
|
})
|
||||||
|
cfg.lsp.servers;
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue