mirror of
https://github.com/golang/go
synced 2024-11-05 11:36:10 -07:00
f217c98fae
The insertion range for completion items was not right. The range's end was 1 before the start. Fix by taking into account the length of the prefix when generating the range start and end. Now instead of a "prefix", we track the completion's "surrounding". This is basically the start and end of the abutting identifier along with the cursor position. When we insert the completion text, we overwrite the entire identifier, not just the prefix. This fixes postfix completion like completing "foo.<>Bar" to "foo.BarBaz". Fixes golang/go#32078 Fixes golang/go#32057 Change-Id: I9d065a413ff9a6e20ae662ff93ad0092c2007c1d GitHub-Last-Rev: af5ab4d60566bf0589d9a712c80d75280178cba9 GitHub-Pull-Request: golang/tools#103 Reviewed-on: https://go-review.googlesource.com/c/tools/+/177757 Run-TryBot: Ian Cottrell <iancottrell@google.com> Reviewed-by: Ian Cottrell <iancottrell@google.com> |
||
---|---|---|
.. | ||
browser | ||
cache | ||
cmd | ||
diff | ||
protocol | ||
snippet | ||
source | ||
testdata | ||
tests | ||
xlog | ||
code_action.go | ||
completion.go | ||
definition.go | ||
diagnostics.go | ||
format.go | ||
general.go | ||
highlight.go | ||
hover.go | ||
info.1.11.go | ||
info.go | ||
link.go | ||
lsp_test.go | ||
reset_golden.sh | ||
server.go | ||
signature_help.go | ||
symbols.go | ||
text_synchronization.go | ||
util.go | ||
workspace.go |