1
0
mirror of https://github.com/golang/go synced 2024-10-01 11:18:32 -06:00
go/internal/lsp/cmd
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
..
check_test.go tools/internal/tool: refactor tool.Main() for testabilty 2019-09-19 22:27:22 +00:00
check.go internal/lsp: use x/xerrors to create new errors 2019-08-06 19:46:56 +00:00
cmd_test.go tools/gopls: add command line support for rename 2019-09-20 22:57:31 +00:00
cmd.go tools/gopls: add command line support for rename 2019-09-20 22:57:31 +00:00
definition_test.go tools/internal/tool: refactor tool.Main() for testabilty 2019-09-19 22:27:22 +00:00
definition.go internal/lsp: show errors when the user is in the wrong directory 2019-09-17 21:41:55 +00:00
export_test.go internal/lsp: refactor query definition test to allow adding a new test 2019-03-18 20:06:54 +00:00
format_test.go tools/internal/tool: refactor tool.Main() for testabilty 2019-09-19 22:27:22 +00:00
format.go internal/lsp: change to protocol.TextEdit for formatting 2019-09-06 17:54:09 +00:00
info.go internal/lsp: move PrintVersionInfo to the debug package 2019-06-03 15:29:06 +00:00
query.go tools/internal/tool: refactor tool.Main() for testabilty 2019-09-19 22:27:22 +00:00
rename_test.go tools/gopls: add command line support for rename 2019-09-20 22:57:31 +00:00
rename.go tools/gopls: add command line support for rename 2019-09-20 22:57:31 +00:00
serve.go x/tools/gopls: reimplement rpc logging at a lower level 2019-08-29 16:05:15 +00:00