Skip to content

How to create add Go HTML templates to LSP? #10665

Answered by alexeypegov
andradei asked this question in Q&A
Discussion options

You must be logged in to vote

You can try something like this, it should give you highlighting and lsp support for both gotmpl and html:

in your languages.toml:

[[language]]
name = "gotmpl"
file-types = ["gohtml"]
language-servers = ["gopls", "vscode-html-language-server"]

And then in ~/.config/helix/runtime/queries/gotmpl/injections.scm:

((text) @injection.content
 (#set! injection.language "html")
 (#set! injection.combined))

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@andradei
Comment options

@alexeypegov
Comment options

@andradei
Comment options

Answer selected by andradei
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants