language/asm: add more filetypes

This commit is contained in:
Snoweuph 2026-04-09 01:45:23 +02:00 committed by Ching Pei Yang
commit 917f9c0ceb
2 changed files with 11 additions and 3 deletions

View file

@ -303,6 +303,8 @@
- Added `languages.jq`. Supports highlighting, formatting and lsp. - Added `languages.jq`. Supports highlighting, formatting and lsp.
- Extend `languages.asm` to support more filetypes out of the box.
- Didn't Add - Didn't Add
[`syntax-gaslighting`](https://github.com/NotAShelf/syntax-gaslighting.nvim), [`syntax-gaslighting`](https://github.com/NotAShelf/syntax-gaslighting.nvim),
you're crazy. you're crazy.

View file

@ -18,7 +18,7 @@
asm-lsp = { asm-lsp = {
enable = true; enable = true;
cmd = [(getExe pkgs.asm-lsp)]; cmd = [(getExe pkgs.asm-lsp)];
filetypes = ["asm" "vmasm"]; filetypes = ["asm" "nasm" "masm" "vmasm" "fasm" "tasm" "tiasm" "asm68k" "asm8300"];
root_markers = [".asm-lsp.toml" ".git"]; root_markers = [".asm-lsp.toml" ".git"];
}; };
}; };
@ -33,7 +33,9 @@ in {
default = config.vim.languages.enableTreesitter; default = config.vim.languages.enableTreesitter;
defaultText = literalExpression "config.vim.languages.enableTreesitter"; defaultText = literalExpression "config.vim.languages.enableTreesitter";
}; };
package = mkGrammarOption pkgs "asm"; packageASM = mkGrammarOption pkgs "asm";
packageNASM = mkGrammarOption pkgs "nasm";
packagePicoASM = mkGrammarOption pkgs "picoasm";
}; };
lsp = { lsp = {
@ -53,7 +55,11 @@ in {
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable (mkMerge [
(mkIf cfg.treesitter.enable { (mkIf cfg.treesitter.enable {
vim.treesitter.enable = true; vim.treesitter.enable = true;
vim.treesitter.grammars = [cfg.treesitter.package]; vim.treesitter.grammars = [
cfg.treesitter.packageASM
cfg.treesitter.packageNASM
cfg.treesitter.packagePicoASM
];
}) })
(mkIf cfg.lsp.enable { (mkIf cfg.lsp.enable {