1
0
mirror of https://github.com/golang/go synced 2024-11-18 20:54:40 -07:00
go/internal/lsp/fake
Rob Findley 49e4010bbf internal/lsp/regtest: implement formatting and organizeImports
Add two new fake editor commands: Formatting and OrganizeImports, which
delegate to textDocument/formatting and textDocument/codeAction
respectively. Use this in simple regtests, as well as on save.

Implementing this required fixing a broken assumption about text edits
in the editor: previously these edits were incrementally mutating the
buffer, but the correct implementation should simultaneously mutate the
buffer (i.e., all positions in an edit set refer to the starting buffer
state). This never mattered before because we were only operating on one
edit at a time.

Updates golang/go#36879

Change-Id: I6dec343c4e202288fa20c26df2fbafe9340a1bce
Reviewed-on: https://go-review.googlesource.com/c/tools/+/221539
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rohan Challa <rohan@golang.org>
2020-03-02 19:16:53 +00:00
..
client.go internal/lsp/regtest: implement formatting and organizeImports 2020-03-02 19:16:53 +00:00
doc.go internal/lsp/fake: add fakes for testing editor interaction 2020-02-10 17:44:19 +00:00
edit_test.go internal/lsp/regtest: implement formatting and organizeImports 2020-03-02 19:16:53 +00:00
edit.go internal/lsp/regtest: implement formatting and organizeImports 2020-03-02 19:16:53 +00:00
editor_test.go internal/lsp/regtest: implement formatting and organizeImports 2020-03-02 19:16:53 +00:00
editor.go internal/lsp/regtest: implement formatting and organizeImports 2020-03-02 19:16:53 +00:00
workspace_test.go internal/lsp/fake: add fakes for testing editor interaction 2020-02-10 17:44:19 +00:00
workspace.go internal/span,lsp: disambiguate URIs, DocumentURIs, and paths 2020-02-14 22:51:03 +00:00