This document describes the LSP-level commands supported by gopls
. They cannot be invoked directly by users, and all the details are subject to change, so nobody should rely on this information.
Identifier: gopls_generate
generate runs go generate
for a given directory.
Identifier: gopls_fill_struct
fill_struct is a gopls command to fill a struct with default values.
Identifier: gopls_regenerate_cgo
regenerate_cgo regenerates cgo definitions.
Identifier: gopls_test
test runs go test
for a specific test function.
Identifier: gopls_tidy
tidy runs go mod tidy
for a module.
Identifier: gopls_undeclared_name
undeclared_name adds a variable declaration for an undeclared name.
Identifier: gopls_upgrade_dependency
upgrade_dependency upgrades a dependency.
Identifier: gopls_vendor
vendor runs go mod vendor
for a module.
Identifier: gopls_extract_variable
extract_variable extracts an expression to a variable.
Identifier: gopls_extract_function
extract_function extracts statements to a function.
Identifier: gopls_gc_details
gc_details controls calculation of gc annotations.
Identifier: gopls_generate_gopls_mod
generate_gopls_mod (re)generates the gopls.mod file.