aboutsummaryrefslogtreecommitdiff
path: root/gopls/internal/lsp/cmd/usage
diff options
context:
space:
mode:
Diffstat (limited to 'gopls/internal/lsp/cmd/usage')
-rw-r--r--gopls/internal/lsp/cmd/usage/api-json.hlp4
-rw-r--r--gopls/internal/lsp/cmd/usage/bug.hlp4
-rw-r--r--gopls/internal/lsp/cmd/usage/call_hierarchy.hlp10
-rw-r--r--gopls/internal/lsp/cmd/usage/check.hlp8
-rw-r--r--gopls/internal/lsp/cmd/usage/definition.hlp15
-rw-r--r--gopls/internal/lsp/cmd/usage/fix.hlp15
-rw-r--r--gopls/internal/lsp/cmd/usage/folding_ranges.hlp8
-rw-r--r--gopls/internal/lsp/cmd/usage/format.hlp18
-rw-r--r--gopls/internal/lsp/cmd/usage/help.hlp10
-rw-r--r--gopls/internal/lsp/cmd/usage/highlight.hlp10
-rw-r--r--gopls/internal/lsp/cmd/usage/implementation.hlp10
-rw-r--r--gopls/internal/lsp/cmd/usage/imports.hlp14
-rw-r--r--gopls/internal/lsp/cmd/usage/inspect.hlp8
-rw-r--r--gopls/internal/lsp/cmd/usage/licenses.hlp4
-rw-r--r--gopls/internal/lsp/cmd/usage/links.hlp12
-rw-r--r--gopls/internal/lsp/cmd/usage/prepare_rename.hlp10
-rw-r--r--gopls/internal/lsp/cmd/usage/references.hlp14
-rw-r--r--gopls/internal/lsp/cmd/usage/remote.hlp8
-rw-r--r--gopls/internal/lsp/cmd/usage/rename.hlp18
-rw-r--r--gopls/internal/lsp/cmd/usage/semtok.hlp8
-rw-r--r--gopls/internal/lsp/cmd/usage/serve.hlp30
-rw-r--r--gopls/internal/lsp/cmd/usage/signature.hlp10
-rw-r--r--gopls/internal/lsp/cmd/usage/symbols.hlp7
-rw-r--r--gopls/internal/lsp/cmd/usage/usage.hlp77
-rw-r--r--gopls/internal/lsp/cmd/usage/version.hlp6
-rw-r--r--gopls/internal/lsp/cmd/usage/vulncheck.hlp17
-rw-r--r--gopls/internal/lsp/cmd/usage/workspace_symbol.hlp13
27 files changed, 368 insertions, 0 deletions
diff --git a/gopls/internal/lsp/cmd/usage/api-json.hlp b/gopls/internal/lsp/cmd/usage/api-json.hlp
new file mode 100644
index 000000000..cb9fbfbea
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/api-json.hlp
@@ -0,0 +1,4 @@
+print json describing gopls API
+
+Usage:
+ gopls [flags] api-json
diff --git a/gopls/internal/lsp/cmd/usage/bug.hlp b/gopls/internal/lsp/cmd/usage/bug.hlp
new file mode 100644
index 000000000..772d54d5f
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/bug.hlp
@@ -0,0 +1,4 @@
+report a bug in gopls
+
+Usage:
+ gopls [flags] bug
diff --git a/gopls/internal/lsp/cmd/usage/call_hierarchy.hlp b/gopls/internal/lsp/cmd/usage/call_hierarchy.hlp
new file mode 100644
index 000000000..07fccc828
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/call_hierarchy.hlp
@@ -0,0 +1,10 @@
+display selected identifier's call hierarchy
+
+Usage:
+ gopls [flags] call_hierarchy <position>
+
+Example:
+
+ $ # 1-indexed location (:line:column or :#offset) of the target identifier
+ $ gopls call_hierarchy helper/helper.go:8:6
+ $ gopls call_hierarchy helper/helper.go:#53
diff --git a/gopls/internal/lsp/cmd/usage/check.hlp b/gopls/internal/lsp/cmd/usage/check.hlp
new file mode 100644
index 000000000..ba89588d5
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/check.hlp
@@ -0,0 +1,8 @@
+show diagnostic results for the specified file
+
+Usage:
+ gopls [flags] check <filename>
+
+Example: show the diagnostic results of this file:
+
+ $ gopls check internal/lsp/cmd/check.go
diff --git a/gopls/internal/lsp/cmd/usage/definition.hlp b/gopls/internal/lsp/cmd/usage/definition.hlp
new file mode 100644
index 000000000..500e6c9a4
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/definition.hlp
@@ -0,0 +1,15 @@
+show declaration of selected identifier
+
+Usage:
+ gopls [flags] definition [definition-flags] <position>
+
+Example: show the definition of the identifier at syntax at offset 44 in this file (flag.FlagSet):
+
+ $ gopls definition internal/lsp/cmd/definition.go:44:47
+ $ gopls definition internal/lsp/cmd/definition.go:#1270
+
+definition-flags:
+ -json
+ emit output in JSON format
+ -markdown
+ support markdown in responses
diff --git a/gopls/internal/lsp/cmd/usage/fix.hlp b/gopls/internal/lsp/cmd/usage/fix.hlp
new file mode 100644
index 000000000..4789a6c5b
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/fix.hlp
@@ -0,0 +1,15 @@
+apply suggested fixes
+
+Usage:
+ gopls [flags] fix [fix-flags] <filename>
+
+Example: apply suggested fixes for this file
+ $ gopls fix -w internal/lsp/cmd/check.go
+
+fix-flags:
+ -a,-all
+ apply all fixes, not just preferred fixes
+ -d,-diff
+ display diffs instead of rewriting files
+ -w,-write
+ write result to (source) file instead of stdout
diff --git a/gopls/internal/lsp/cmd/usage/folding_ranges.hlp b/gopls/internal/lsp/cmd/usage/folding_ranges.hlp
new file mode 100644
index 000000000..4af2da615
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/folding_ranges.hlp
@@ -0,0 +1,8 @@
+display selected file's folding ranges
+
+Usage:
+ gopls [flags] folding_ranges <file>
+
+Example:
+
+ $ gopls folding_ranges helper/helper.go
diff --git a/gopls/internal/lsp/cmd/usage/format.hlp b/gopls/internal/lsp/cmd/usage/format.hlp
new file mode 100644
index 000000000..7ef0bbe43
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/format.hlp
@@ -0,0 +1,18 @@
+format the code according to the go standard
+
+Usage:
+ gopls [flags] format [format-flags] <filerange>
+
+The arguments supplied may be simple file names, or ranges within files.
+
+Example: reformat this file:
+
+ $ gopls format -w internal/lsp/cmd/check.go
+
+format-flags:
+ -d,-diff
+ display diffs instead of rewriting files
+ -l,-list
+ list files whose formatting differs from gofmt's
+ -w,-write
+ write result to (source) file instead of stdout
diff --git a/gopls/internal/lsp/cmd/usage/help.hlp b/gopls/internal/lsp/cmd/usage/help.hlp
new file mode 100644
index 000000000..f0ff44a4d
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/help.hlp
@@ -0,0 +1,10 @@
+print usage information for subcommands
+
+Usage:
+ gopls [flags] help
+
+
+Examples:
+$ gopls help # main gopls help message
+$ gopls help remote # help on 'remote' command
+$ gopls help remote sessions # help on 'remote sessions' subcommand
diff --git a/gopls/internal/lsp/cmd/usage/highlight.hlp b/gopls/internal/lsp/cmd/usage/highlight.hlp
new file mode 100644
index 000000000..e128eb7de
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/highlight.hlp
@@ -0,0 +1,10 @@
+display selected identifier's highlights
+
+Usage:
+ gopls [flags] highlight <position>
+
+Example:
+
+ $ # 1-indexed location (:line:column or :#offset) of the target identifier
+ $ gopls highlight helper/helper.go:8:6
+ $ gopls highlight helper/helper.go:#53
diff --git a/gopls/internal/lsp/cmd/usage/implementation.hlp b/gopls/internal/lsp/cmd/usage/implementation.hlp
new file mode 100644
index 000000000..09414f190
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/implementation.hlp
@@ -0,0 +1,10 @@
+display selected identifier's implementation
+
+Usage:
+ gopls [flags] implementation <position>
+
+Example:
+
+ $ # 1-indexed location (:line:column or :#offset) of the target identifier
+ $ gopls implementation helper/helper.go:8:6
+ $ gopls implementation helper/helper.go:#53
diff --git a/gopls/internal/lsp/cmd/usage/imports.hlp b/gopls/internal/lsp/cmd/usage/imports.hlp
new file mode 100644
index 000000000..295f4daa2
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/imports.hlp
@@ -0,0 +1,14 @@
+updates import statements
+
+Usage:
+ gopls [flags] imports [imports-flags] <filename>
+
+Example: update imports statements in a file:
+
+ $ gopls imports -w internal/lsp/cmd/check.go
+
+imports-flags:
+ -d,-diff
+ display diffs instead of rewriting files
+ -w,-write
+ write result to (source) file instead of stdout
diff --git a/gopls/internal/lsp/cmd/usage/inspect.hlp b/gopls/internal/lsp/cmd/usage/inspect.hlp
new file mode 100644
index 000000000..3d0a0f3c4
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/inspect.hlp
@@ -0,0 +1,8 @@
+interact with the gopls daemon (deprecated: use 'remote')
+
+Usage:
+ gopls [flags] inspect <subcommand> [arg]...
+
+Subcommand:
+ sessions print information about current gopls sessions
+ debug start the debug server
diff --git a/gopls/internal/lsp/cmd/usage/licenses.hlp b/gopls/internal/lsp/cmd/usage/licenses.hlp
new file mode 100644
index 000000000..ab60ebc2f
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/licenses.hlp
@@ -0,0 +1,4 @@
+print licenses of included software
+
+Usage:
+ gopls [flags] licenses
diff --git a/gopls/internal/lsp/cmd/usage/links.hlp b/gopls/internal/lsp/cmd/usage/links.hlp
new file mode 100644
index 000000000..7f7612ce7
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/links.hlp
@@ -0,0 +1,12 @@
+list links in a file
+
+Usage:
+ gopls [flags] links [links-flags] <filename>
+
+Example: list links contained within a file:
+
+ $ gopls links internal/lsp/cmd/check.go
+
+links-flags:
+ -json
+ emit document links in JSON format
diff --git a/gopls/internal/lsp/cmd/usage/prepare_rename.hlp b/gopls/internal/lsp/cmd/usage/prepare_rename.hlp
new file mode 100644
index 000000000..7f8a6f32d
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/prepare_rename.hlp
@@ -0,0 +1,10 @@
+test validity of a rename operation at location
+
+Usage:
+ gopls [flags] prepare_rename <position>
+
+Example:
+
+ $ # 1-indexed location (:line:column or :#offset) of the target identifier
+ $ gopls prepare_rename helper/helper.go:8:6
+ $ gopls prepare_rename helper/helper.go:#53
diff --git a/gopls/internal/lsp/cmd/usage/references.hlp b/gopls/internal/lsp/cmd/usage/references.hlp
new file mode 100644
index 000000000..c55ef0337
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/references.hlp
@@ -0,0 +1,14 @@
+display selected identifier's references
+
+Usage:
+ gopls [flags] references [references-flags] <position>
+
+Example:
+
+ $ # 1-indexed location (:line:column or :#offset) of the target identifier
+ $ gopls references helper/helper.go:8:6
+ $ gopls references helper/helper.go:#53
+
+references-flags:
+ -d,-declaration
+ include the declaration of the specified identifier in the results
diff --git a/gopls/internal/lsp/cmd/usage/remote.hlp b/gopls/internal/lsp/cmd/usage/remote.hlp
new file mode 100644
index 000000000..dd6034f46
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/remote.hlp
@@ -0,0 +1,8 @@
+interact with the gopls daemon
+
+Usage:
+ gopls [flags] remote <subcommand> [arg]...
+
+Subcommand:
+ sessions print information about current gopls sessions
+ debug start the debug server
diff --git a/gopls/internal/lsp/cmd/usage/rename.hlp b/gopls/internal/lsp/cmd/usage/rename.hlp
new file mode 100644
index 000000000..ae58cbf60
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/rename.hlp
@@ -0,0 +1,18 @@
+rename selected identifier
+
+Usage:
+ gopls [flags] rename [rename-flags] <position> <name>
+
+Example:
+
+ $ # 1-based location (:line:column or :#position) of the thing to change
+ $ gopls rename helper/helper.go:8:6 Foo
+ $ gopls rename helper/helper.go:#53 Foo
+
+rename-flags:
+ -d,-diff
+ display diffs instead of rewriting files
+ -preserve
+ preserve original files
+ -w,-write
+ write result to (source) file instead of stdout
diff --git a/gopls/internal/lsp/cmd/usage/semtok.hlp b/gopls/internal/lsp/cmd/usage/semtok.hlp
new file mode 100644
index 000000000..459ed596c
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/semtok.hlp
@@ -0,0 +1,8 @@
+show semantic tokens for the specified file
+
+Usage:
+ gopls [flags] semtok <filename>
+
+Example: show the semantic tokens for this file:
+
+ $ gopls semtok internal/lsp/cmd/semtok.go
diff --git a/gopls/internal/lsp/cmd/usage/serve.hlp b/gopls/internal/lsp/cmd/usage/serve.hlp
new file mode 100644
index 000000000..370cbce83
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/serve.hlp
@@ -0,0 +1,30 @@
+run a server for Go code using the Language Server Protocol
+
+Usage:
+ gopls [flags] serve [server-flags]
+ gopls [flags] [server-flags]
+
+The server communicates using JSONRPC2 on stdin and stdout, and is intended to be run directly as
+a child of an editor process.
+
+server-flags:
+ -debug=string
+ serve debug information on the supplied address
+ -listen=string
+ address on which to listen for remote connections. If prefixed by 'unix;', the subsequent address is assumed to be a unix domain socket. Otherwise, TCP is used.
+ -listen.timeout=duration
+ when used with -listen, shut down the server when there are no connected clients for this duration
+ -logfile=string
+ filename to log to. if value is "auto", then logging to a default output file is enabled
+ -mode=string
+ no effect
+ -port=int
+ port on which to run gopls for debugging purposes
+ -remote.debug=string
+ when used with -remote=auto, the -debug value used to start the daemon
+ -remote.listen.timeout=duration
+ when used with -remote=auto, the -listen.timeout value used to start the daemon (default 1m0s)
+ -remote.logfile=string
+ when used with -remote=auto, the -logfile value used to start the daemon
+ -rpc.trace
+ print the full rpc trace in lsp inspector format
diff --git a/gopls/internal/lsp/cmd/usage/signature.hlp b/gopls/internal/lsp/cmd/usage/signature.hlp
new file mode 100644
index 000000000..f9fd0bfb7
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/signature.hlp
@@ -0,0 +1,10 @@
+display selected identifier's signature
+
+Usage:
+ gopls [flags] signature <position>
+
+Example:
+
+ $ # 1-indexed location (:line:column or :#offset) of the target identifier
+ $ gopls signature helper/helper.go:8:6
+ $ gopls signature helper/helper.go:#53
diff --git a/gopls/internal/lsp/cmd/usage/symbols.hlp b/gopls/internal/lsp/cmd/usage/symbols.hlp
new file mode 100644
index 000000000..2aa36aa84
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/symbols.hlp
@@ -0,0 +1,7 @@
+display selected file's symbols
+
+Usage:
+ gopls [flags] symbols <file>
+
+Example:
+ $ gopls symbols helper/helper.go
diff --git a/gopls/internal/lsp/cmd/usage/usage.hlp b/gopls/internal/lsp/cmd/usage/usage.hlp
new file mode 100644
index 000000000..404750b7d
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/usage.hlp
@@ -0,0 +1,77 @@
+
+gopls is a Go language server.
+
+It is typically used with an editor to provide language features. When no
+command is specified, gopls will default to the 'serve' command. The language
+features can also be accessed via the gopls command-line interface.
+
+Usage:
+ gopls help [<subject>]
+
+Command:
+
+Main
+ serve run a server for Go code using the Language Server Protocol
+ version print the gopls version information
+ bug report a bug in gopls
+ help print usage information for subcommands
+ api-json print json describing gopls API
+ licenses print licenses of included software
+
+Features
+ call_hierarchy display selected identifier's call hierarchy
+ check show diagnostic results for the specified file
+ definition show declaration of selected identifier
+ folding_ranges display selected file's folding ranges
+ format format the code according to the go standard
+ highlight display selected identifier's highlights
+ implementation display selected identifier's implementation
+ imports updates import statements
+ remote interact with the gopls daemon
+ inspect interact with the gopls daemon (deprecated: use 'remote')
+ links list links in a file
+ prepare_rename test validity of a rename operation at location
+ references display selected identifier's references
+ rename rename selected identifier
+ semtok show semantic tokens for the specified file
+ signature display selected identifier's signature
+ fix apply suggested fixes
+ symbols display selected file's symbols
+ workspace_symbol search symbols in workspace
+ vulncheck run experimental vulncheck analysis (experimental: under development)
+
+flags:
+ -debug=string
+ serve debug information on the supplied address
+ -listen=string
+ address on which to listen for remote connections. If prefixed by 'unix;', the subsequent address is assumed to be a unix domain socket. Otherwise, TCP is used.
+ -listen.timeout=duration
+ when used with -listen, shut down the server when there are no connected clients for this duration
+ -logfile=string
+ filename to log to. if value is "auto", then logging to a default output file is enabled
+ -mode=string
+ no effect
+ -ocagent=string
+ the address of the ocagent (e.g. http://localhost:55678), or off (default "off")
+ -port=int
+ port on which to run gopls for debugging purposes
+ -profile.cpu=string
+ write CPU profile to this file
+ -profile.mem=string
+ write memory profile to this file
+ -profile.trace=string
+ write trace log to this file
+ -remote=string
+ forward all commands to a remote lsp specified by this flag. With no special prefix, this is assumed to be a TCP address. If prefixed by 'unix;', the subsequent address is assumed to be a unix domain socket. If 'auto', or prefixed by 'auto;', the remote address is automatically resolved based on the executing environment.
+ -remote.debug=string
+ when used with -remote=auto, the -debug value used to start the daemon
+ -remote.listen.timeout=duration
+ when used with -remote=auto, the -listen.timeout value used to start the daemon (default 1m0s)
+ -remote.logfile=string
+ when used with -remote=auto, the -logfile value used to start the daemon
+ -rpc.trace
+ print the full rpc trace in lsp inspector format
+ -v,-verbose
+ verbose output
+ -vv,-veryverbose
+ very verbose output
diff --git a/gopls/internal/lsp/cmd/usage/version.hlp b/gopls/internal/lsp/cmd/usage/version.hlp
new file mode 100644
index 000000000..3a09ddedf
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/version.hlp
@@ -0,0 +1,6 @@
+print the gopls version information
+
+Usage:
+ gopls [flags] version
+ -json
+ outputs in json format.
diff --git a/gopls/internal/lsp/cmd/usage/vulncheck.hlp b/gopls/internal/lsp/cmd/usage/vulncheck.hlp
new file mode 100644
index 000000000..4fbe573e2
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/vulncheck.hlp
@@ -0,0 +1,17 @@
+run experimental vulncheck analysis (experimental: under development)
+
+Usage:
+ gopls [flags] vulncheck
+
+ WARNING: this command is experimental.
+
+ By default, the command outputs a JSON-encoded
+ golang.org/x/tools/gopls/internal/lsp/command.VulncheckResult
+ message.
+ Example:
+ $ gopls vulncheck <packages>
+
+ -config
+ If true, the command reads a JSON-encoded package load configuration from stdin
+ -summary
+ If true, outputs a JSON-encoded govulnchecklib.Summary JSON
diff --git a/gopls/internal/lsp/cmd/usage/workspace_symbol.hlp b/gopls/internal/lsp/cmd/usage/workspace_symbol.hlp
new file mode 100644
index 000000000..a61b47b33
--- /dev/null
+++ b/gopls/internal/lsp/cmd/usage/workspace_symbol.hlp
@@ -0,0 +1,13 @@
+search symbols in workspace
+
+Usage:
+ gopls [flags] workspace_symbol [workspace_symbol-flags] <query>
+
+Example:
+
+ $ gopls workspace_symbol -matcher fuzzy 'wsymbols'
+
+workspace_symbol-flags:
+ -matcher=string
+ specifies the type of matcher: fuzzy, caseSensitive, or caseInsensitive.
+ The default is caseInsensitive.