From c6ae451aecaf464746839c71164c16e2a397c416 Mon Sep 17 00:00:00 2001 From: Robert Findley Date: Wed, 15 Dec 2021 11:11:13 -0500 Subject: [PATCH] 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 Run-TryBot: Robert Findley gopls-CI: kokoro TryBot-Result: Gopher Robot Reviewed-by: Hyang-Ah Hana Kim --- gopls/doc/features.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gopls/doc/features.md b/gopls/doc/features.md index ccfe138b2f..40b89391c3 100644 --- a/gopls/doc/features.md +++ b/gopls/doc/features.md @@ -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. + +