mirror of https://github.com/golang/go.git
Template tokenization was handling quoting incorrectly.
(The previous code would misunderstand {{"{{"}}.)
While the user is typing an action in a template file the template
parser was returning a correct but useless error, so gopls had no
information about the file. The new code improves this by tokenizing
and parsing an adjusted version of the file. That is, it can sometimes
tell when the user has started typing an action so the {{, }} delimiters
are unbalanced. It replaces the new {{ by blanks, thereby suppressing
a lot of useless error messages from gopls.
Something like this seems to be a prerequisite for provdiding completions
based on the contents of the rest of the file.
Change-Id: I6b6396a4d9e599d671e778b303e6628642585a90
Reviewed-on: https://go-review.googlesource.com/c/tools/+/337351
Run-TryBot: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Trust: Peter Weinberger <pjw@google.com>
|
||
|---|---|---|
| .. | ||
| completion.go | ||
| highlight.go | ||
| implementations.go | ||
| parse.go | ||
| parse_test.go | ||
| symbols.go | ||