1
0
mirror of https://github.com/golang/go synced 2024-11-05 11:36:10 -07:00
go/internal/lsp
Muir Manders f217c98fae internal/lsp: fix completion insertion
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>
2019-05-17 18:32:58 +00:00
..
browser internal/lsp: add version and bug commands 2019-05-11 04:16:02 +00:00
cache internal/lsp: support definitions and hover for builtins 2019-05-17 00:35:10 +00:00
cmd internal/lsp: support definitions and hover for builtins 2019-05-17 00:35:10 +00:00
diff internal/lsp: normalise and make public diff<->edit conversions 2019-04-15 20:31:36 +00:00
protocol internal/lsp: respond to shutdown requests and add DO NOT EDITs 2019-05-13 17:21:55 +00:00
snippet internal/lsp: introduce snippet builder object 2019-04-25 18:37:29 +00:00
source internal/lsp: fix completion insertion 2019-05-17 18:32:58 +00:00
testdata internal/lsp: fix completion insertion 2019-05-17 18:32:58 +00:00
tests internal/lsp: fix completion insertion 2019-05-17 18:32:58 +00:00
xlog internal/lsp: add the ability to log back to the client 2019-04-01 16:22:08 +00:00
code_action.go internal/lsp: add structured layers to the cache 2019-05-16 21:30:38 +00:00
completion.go internal/lsp: fix completion insertion 2019-05-17 18:32:58 +00:00
definition.go internal/lsp: add structured layers to the cache 2019-05-16 21:30:38 +00:00
diagnostics.go internal/lsp: add structured layers to the cache 2019-05-16 21:30:38 +00:00
format.go internal/lsp: add structured layers to the cache 2019-05-16 21:30:38 +00:00
general.go internal/lsp: add structured layers to the cache 2019-05-16 21:30:38 +00:00
highlight.go internal/lsp: add structured layers to the cache 2019-05-16 21:30:38 +00:00
hover.go internal/lsp: add structured layers to the cache 2019-05-16 21:30:38 +00:00
info.1.11.go internal/lsp: add version and bug commands 2019-05-11 04:16:02 +00:00
info.go internal/lsp: add version and bug commands 2019-05-11 04:16:02 +00:00
link.go internal/lsp: add structured layers to the cache 2019-05-16 21:30:38 +00:00
lsp_test.go internal/lsp: support definitions and hover for builtins 2019-05-17 00:35:10 +00:00
reset_golden.sh internal/lsp: fix definition tests to use golden files 2019-05-10 21:06:55 +00:00
server.go internal/lsp: add structured layers to the cache 2019-05-16 21:30:38 +00:00
signature_help.go internal/lsp: add structured layers to the cache 2019-05-16 21:30:38 +00:00
symbols.go internal/lsp: add structured layers to the cache 2019-05-16 21:30:38 +00:00
text_synchronization.go internal/lsp: add structured layers to the cache 2019-05-16 21:30:38 +00:00
util.go internal/lsp: prepare for non go files 2019-05-15 23:59:46 +00:00
workspace.go internal/lsp: add structured layers to the cache 2019-05-16 21:30:38 +00:00