Features 5 - WhoIsSethDaniel/goldsmith.nvim GitHub Wiki

Coverage Report

The following screencast shows Goldsmith can annotate the current buffer after running a coverage report, will store the coverage data, and can turn on annotations in buffers of files that were affected by the report. In this example the user types ":GoCoverage", the coverage report is generated, and the buffer changes to reflect the coverage report. The user then types ":GoCoverageFiles" which shows all the files affected by the report. The user then opens a buffer with one of the affected files and runs ":GoCoverageOn" which immediately shows the annotations for that buffer. The user then runs ":GoCoverageOff" which turns off annotations for that buffer, moves back to the previous buffer and turns off annotations there. Not shown: the command ":GoCoverageBrowser" which will generate the coverage report and display it in a web browser.

Goldsmith coverage example

Statusline Integration

The following screencast shows Goldsmith's statusline integration. The statusline starts off with 🇬🌞╌ which shows that Goldsmith helps to manage this buffer (🇬), that everything appears okay (🌞), and that there is no coverage data for the open file (╌). The user then runs ":GoCoverage" and the statusline changes to show that the job is running. It shows both that 1 job is running and a short description of that job. When the job completes the statusline shows that there is coverage data available for the current buffer using ⨁ .

Goldsmith statusline example

Convert JSON to Go Struct

The following screencast shows Goldsmith's ability to take JSON and convert it to a Go struct. Goldsmith can do this in several ways. The way shown here is a JSON struct in the document that is visually selected and then the user runs ":GoToStruct" and the visual selection is converted to the Go struct. Notice that the JSON is commented out, :GoToStruct can deal with JSON that is in comments (or not). Other ways this can work: by default :GoToStruct, if there is no visual selection, will read from the + register and will use the JSON there (if any) to create the JSON struct. There is also a second command: :GoToStructReg which works the same as :GoToStruct, but instead of writing the generated struct to the buffer will write it to the * register (by default).

Goldsmith JSON-to-struct example

GO TO PAGE 6 --->