diff --git a/docs/manual/release-notes/rl-0.9.md b/docs/manual/release-notes/rl-0.9.md index 5415d936..a6e5dfd6 100644 --- a/docs/manual/release-notes/rl-0.9.md +++ b/docs/manual/release-notes/rl-0.9.md @@ -229,6 +229,9 @@ [Snoweuph](https://github.com/snoweuph) +- Fix `tressiter` to allow `null` in grammar options, so they can be filtered + out. + - Added [Selenen](https://github.com/kampfkarren/selene) for more diagnostics in `languages.lua`. @@ -304,6 +307,8 @@ - Added `languages.jq`. Supports highlighting, formatting and lsp. +- Extend `languages.asm` to support more filetypes out of the box. + - Didn't Add [`syntax-gaslighting`](https://github.com/NotAShelf/syntax-gaslighting.nvim), you're crazy. diff --git a/modules/plugins/languages/asm.nix b/modules/plugins/languages/asm.nix index eccc91e7..f1831401 100644 --- a/modules/plugins/languages/asm.nix +++ b/modules/plugins/languages/asm.nix @@ -18,7 +18,7 @@ asm-lsp = { enable = true; cmd = [(getExe pkgs.asm-lsp)]; - filetypes = ["asm" "vmasm"]; + filetypes = ["asm" "nasm" "masm" "vmasm" "fasm" "tasm" "tiasm" "asm68k" "asm8300"]; root_markers = [".asm-lsp.toml" ".git"]; }; }; @@ -33,7 +33,9 @@ in { default = config.vim.languages.enableTreesitter; defaultText = literalExpression "config.vim.languages.enableTreesitter"; }; - package = mkGrammarOption pkgs "asm"; + packageASM = mkGrammarOption pkgs "asm"; + packageNASM = mkGrammarOption pkgs "nasm"; + packageRpiPicoASM = mkGrammarOption pkgs "pioasm"; }; lsp = { @@ -53,7 +55,11 @@ in { config = mkIf cfg.enable (mkMerge [ (mkIf cfg.treesitter.enable { vim.treesitter.enable = true; - vim.treesitter.grammars = [cfg.treesitter.package]; + vim.treesitter.grammars = [ + cfg.treesitter.packageASM + cfg.treesitter.packageNASM + cfg.treesitter.packageRpiPicoASM + ]; }) (mkIf cfg.lsp.enable { diff --git a/modules/plugins/treesitter/treesitter.nix b/modules/plugins/treesitter/treesitter.nix index c2039a9f..a25c1d3f 100644 --- a/modules/plugins/treesitter/treesitter.nix +++ b/modules/plugins/treesitter/treesitter.nix @@ -4,7 +4,7 @@ ... }: let inherit (lib.options) mkOption mkEnableOption literalExpression; - inherit (lib.types) listOf package bool; + inherit (lib.types) listOf nullOr package bool; in { options.vim.treesitter = { enable = mkEnableOption "treesitter, also enabled automatically through language options"; @@ -13,7 +13,7 @@ in { autotagHtml = mkEnableOption "autoclose and rename html tag"; grammars = mkOption { - type = listOf package; + type = listOf (nullOr package); default = []; example = literalExpression '' with pkgs.vimPlugins.nvim-treesitter.grammarPlugins; [