Merge pull request #1505 from snoweuph/patch/asm

language/asm: add more filetypes
This commit is contained in:
Ching Pei Yang 2026-04-10 15:30:20 +02:00 committed by GitHub
commit 63d5d8b2d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 3 deletions

View file

@ -303,6 +303,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.

View file

@ -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";
packagePicoASM = mkGrammarOption pkgs "picoasm";
};
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.packagePicoASM
];
})
(mkIf cfg.lsp.enable {