gopls/doc: add some commentary on editor configuration for templates

Change-Id: I3d9298f4f033a86e52419ac2187ecc5e69e7f9d6
Reviewed-on: https://go-review.googlesource.com/c/tools/+/372255
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
Robert Findley 2021-12-15 11:11:13 -05:00
parent cd2143c081
commit c6ae451aec
1 changed files with 10 additions and 0 deletions

View File

@ -43,4 +43,14 @@ it is presented as a diagnostic. (Missing functions do not produce errors.)
+ **Definitions**: gopls provides jump-to-definition inside templates, though it does not understand scoping (all templates are considered to be in one global scope).
+ **References**: gopls provides find-references, with the same scoping limitation as definitions.
+ **Completions**: gopls will attempt to suggest completions inside templates.
### Configuring your editor
In addition to configuring `templateExtensions`, you may need to configure your
editor or LSP client to activate `gopls` for template files. In recent versions
of `VS Code Go`, this happens automatically for files ending in `.tmpl` or
`.gotmpl`. In Vim, you may need to configure your LSP client to operate on the
`template` filetype.
<!--TODO(rstambler): Automatically generate a list of supported features.-->