Features 1 - WhoIsSethDaniel/goldsmith.nvim GitHub Wiki

Codelens Support

The following demonstrates the basic codelens support that Goldsmith has. You will notice at the top of the file there is some virtual text that says, "Toggle GC Annotation Details". This is a "codelens". The user, on the line with the codelens, then enters ":GoCodeLensRun" to run that lens. You will then notice that various details about what variables would escape to the heap, inlining, and other things, appear as virtual text. The user then enters ":GoCodeLensRun" again to turn off the lens. The user enters ":GoCodeLensOff" to turn off the code lens virtual text completely.

Goldsmith Codelens example

Go Module Check-for-updates

The following demonstrates the basic go.mod support that Goldsmith has. Codelens support will also allow you to do this using the :CodeLens* commands, but for this demo the codelens support is turned off. The user will enter ":GoModCheck" and virtual text will appear that will show which packages are out-of-date. The user will move up and down the list of packages to show that a code action is available for each of the needs-to-be-updated packages. Running the code action will update the package.

Goldsmith Go module update example

Run goimports on save

The following shows Goldsmith instructing gopls to run goimports when the file is being saved. You can see the user add something to the code from the http package. Upon save the imports line us updated to include the net/http package.

Goldsmith goimports on save exmample

GO TO PAGE 2 --->