mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-27 11:55:22 +00:00
languages/go: add injections for gotmpl
This commit is contained in:
parent
c4b940239b
commit
56db4e1cbd
3 changed files with 28 additions and 2 deletions
|
|
@ -104,6 +104,10 @@
|
|||
|
||||
- Renamed `languages.ts` to `languages.typescript`.
|
||||
|
||||
- Added {option}`vim.languages.go.treesitter.gotmpl.injection` and Renamed
|
||||
`languages.go.treesitter.gotmplPackage` to
|
||||
{option}`vim.languages.go.treesitter.gotmpl.package`
|
||||
|
||||
## Changelog {#sec-release-0-9-changelog}
|
||||
|
||||
[SecBear](https://github.com/SecBear):
|
||||
|
|
|
|||
|
|
@ -362,6 +362,7 @@ in {
|
|||
# 2026-04-19
|
||||
[
|
||||
(mkRenamedOptionModule ["vim" "utility" "vim-wakatime" "cli-path"] ["vim" "utility" "vim-wakatime" "setupOpts" "cli_path"])
|
||||
(mkRenamedOptionModule ["vim" "languages" "go" "treesitter" "gotmplPackage"] ["vim" "languages" "go" "treesitter" "gotmpl" "package"])
|
||||
]
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,7 +143,14 @@ in {
|
|||
gomodPackage = mkGrammarOption pkgs "gomod";
|
||||
gosumPackage = mkGrammarOption pkgs "gosum";
|
||||
goworkPackage = mkGrammarOption pkgs "gowork";
|
||||
gotmplPackage = mkGrammarOption pkgs "gotmpl";
|
||||
gotmpl = {
|
||||
package = mkGrammarOption pkgs "gotmpl";
|
||||
injection = mkOption {
|
||||
type = str;
|
||||
default = "html";
|
||||
description = "Treesitter language to inject in Go templates";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
lsp = {
|
||||
|
|
@ -274,7 +281,21 @@ in {
|
|||
cfg.treesitter.gomodPackage
|
||||
cfg.treesitter.gosumPackage
|
||||
cfg.treesitter.goworkPackage
|
||||
cfg.treesitter.gotmplPackage
|
||||
cfg.treesitter.gotmpl.package
|
||||
];
|
||||
queries = [
|
||||
{
|
||||
type = "injections";
|
||||
filetypes = ["gotmpl"];
|
||||
content = ''
|
||||
;; extends
|
||||
|
||||
((text) @injection.content
|
||||
(#set! injection.language "${cfg.treesitter.gotmpl.injection}")
|
||||
(#set! injection.combined)
|
||||
)
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue