1
0
mirror of https://github.com/golang/go synced 2024-11-19 06:04:39 -07:00
go/internal/lsp/testdata/rename/testy
hartzell 5eefd052ad tools/gopls: add command line support for rename
This commit adds support for calling rename from the gopls command
line, e.g.

$ gopls rename -w ~/tmp/foo/main.go:8:6
$ gopls rename -w ~/tmp/foo/main.go:#53

Optional arguments are:

- -w, which writes the changes back to the original file; and
- -d, which prints a unified diff to stdout

With no arguments, the changed files are printed to stdout.

It:

- adds internal/lsp/cmd/rename.go, which implements the command;
- adds "rename" to the list of commands in internal/lsp/cmd/cmd.go;
- removes the dummy test from internal/lsp/cmd/cmd_test.go; and
- adds internal/lsp/cmd/rename_test.go, which uses the existing
  "golden" data to implement its tests.

Updates #32875

Change-Id: I5cab5a40b4aa26357b26b0caf4ed54dbd2284d0f
GitHub-Last-Rev: fe853d325ef91f8f911987790fcba7a5a777b6ce
GitHub-Pull-Request: golang/tools#157
Reviewed-on: https://go-review.googlesource.com/c/tools/+/194878
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
2019-09-20 22:57:31 +00:00
..
testy_test.go internal/lsp: rename identifiers in test packages 2019-07-09 21:17:00 +00:00
testy_test.go.golden tools/gopls: add command line support for rename 2019-09-20 22:57:31 +00:00
testy.go internal/lsp: fix bug renaming local vars with test files present 2019-08-15 14:43:58 +00:00
testy.go.golden tools/gopls: add command line support for rename 2019-09-20 22:57:31 +00:00