golang.org/x/tools/gopls@v0.15.3/internal/cmd/usage/execute.hlp (about)

     1  Execute a gopls custom LSP command
     2  
     3  Usage:
     4    gopls [flags] execute [flags] command argument...
     5  
     6  The execute command sends an LSP ExecuteCommand request to gopls,
     7  with a set of optional JSON argument values.
     8  Some commands return a result, also JSON.
     9  
    10  Available commands are documented at:
    11  
    12  	https://github.com/golang/tools/blob/master/gopls/doc/commands.md
    13  
    14  This interface is experimental and commands may change or disappear without notice.
    15  
    16  Examples:
    17  
    18  	$ gopls execute gopls.add_import '{"ImportPath": "fmt", "URI": "file:///hello.go"}'
    19  	$ gopls execute gopls.run_tests '{"URI": "file:///a_test.go", "Tests": ["Test"]}'
    20  	$ gopls execute gopls.list_known_packages '{"URI": "file:///hello.go"}'
    21  
    22  execute-flags:
    23    -d,-diff
    24      	display diffs instead of edited file content
    25    -l,-list
    26      	display names of edited files
    27    -preserve
    28      	with -write, make copies of original files
    29    -w,-write
    30      	write edited content to source files