mirror of
https://github.com/golang/go
synced 2024-11-18 16:44:43 -07:00
88e652f7a8
Dangling selectors such as: func _() { x. } var x struct { i int } tend to wreak havoc on the AST. In the above example you didn't used to get completions because the declaration of "x" was missing from the AST. We now work around this issue by inserting a "_" into the source code before parsing to make the selector valid: func _() { x._ // <-- insert "_" here } var x struct { i int } This makes completion work as expected because the declaration of "x" is present in the AST. I had to change fixAST() to be called before fixSrc() because otherwise this new workaround in fixSrc() breaks the "accidental keyword" countermeasures in fixAST(). Fixes golang/go#31973. Updates golang/go#31687. Change-Id: Ia7ef6c045a9c71502d1b8b36f187ac9b8a85fe21 Reviewed-on: https://go-review.googlesource.com/c/tools/+/216484 Run-TryBot: Muir Manders <muir@mnd.rs> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org> |
||
---|---|---|
.. | ||
apidiff | ||
fastwalk | ||
gopathwalk | ||
imports | ||
jsonrpc2 | ||
lsp | ||
memoize | ||
packagesinternal | ||
span | ||
telemetry | ||
testenv | ||
tool | ||
xcontext |