| Execute a gopls custom LSP command |
| |
| Usage: |
| gopls [flags] execute [flags] command argument... |
| |
| The execute command sends an LSP ExecuteCommand request to gopls, |
| with a set of optional JSON argument values. |
| Some commands return a result, also JSON. |
| |
| Available commands are documented at: |
| |
| https://github.com/golang/tools/blob/master/gopls/doc/commands.md |
| |
| This interface is experimental and commands may change or disappear without notice. |
| |
| Examples: |
| |
| $ gopls execute gopls.add_import '{"ImportPath": "fmt", "URI": "file:///hello.go"}' |
| $ gopls execute gopls.run_tests '{"URI": "file:///a_test.go", "Tests": ["Test"]}' |
| $ gopls execute gopls.list_known_packages '{"URI": "file:///hello.go"}' |
| |
| execute-flags: |
| -d,-diff |
| display diffs instead of edited file content |
| -l,-list |
| display names of edited files |
| -preserve |
| with -write, make copies of original files |
| -w,-write |
| write edited content to source files |