Smoke Test
Before releasing a new version of the extension, please run the following smoke test to make sure that all features are working.
Set up
First, clone golang.org/x/example. At the time of writing (June 2020), this repository has not changed since 2017. If it has changed since, these steps may not be exactly reproducible and should be adjusted.
For now, we smoke test the extension only in GOPATH
mode.
If it does not already exist:
mkdir $GOPATH/src/github.com/golang
Then,
cd $GOPATH/src/github.com/golang
git clone https://github.com/golang/example
cd example
Next, build and sideload the modified Go extension and open the example/hello
directory. Open hello.go
.
Test code navigation
- Go to definition on
fmt.Println
. - Go to definition on
stringutil.Reverse
. - Find all references of
fmt.Println
. - Find all references of
stringutil.Reverse
. - Hover over
fmt.Println
. - Hover over
stringutil.Reverse
.
Test autocompletion
- Trigger autocompletion (Ctrl+Space) after
fmt.
. - Trigger autocompletion (Ctrl+Space) after
stringutil.
. - Enter a newline in the
main
function and typefmt.
. - Enter a newline in the
main
function and typeparser.
. Expect suggestions from the unimported standard librarygo/parser
package. - Enter a newline in the
main
function and typefmt.
. Select thefmt.Println
completion and observe the outcome. Toggle thego.useCodeSnippetsOnFunctionSuggest
setting to ensure that placeholders are provided. - Test signature help by manually triggering it (Ctrl+Shift+Space) while completing
fmt.Println
. - Test signature help by manually triggering it (Ctrl+Shift+Space) while completing
stringutil.Reverse
.
Test diagnostics
Enable go.buildOnSave
, go.vetOnSave
, and go.lintOnSave
.
- Add
var x int
to themain
function and expect a build diagnostic. - Add
fmt.Printf("hi", 1)
and expect a vet diagnostic. Add the following function to the bottom of the file and expect a lint diagnostic.
// Hello is hi.
func Hi() {}
You can also try toggling the "package"
and "workspace"
configurations for these settings.
Test formatting and import organization
- Hit enter 3 times in the
main
function and save. Expect formatting to remove all but one line. - Remove the
"fmt"
import. Save and expect it to return. - Remove the
"github.com/golang/example/stringutil"
import. Save and expect it to return. - Confirm that the
Go: Add Import
command works (add"archive/tar"
).
Test renaming
Add the following to the
main
function, then renamex
toy
.var x int
fmt.Println(x)
Rename
stringutil.Reverse
.reverse.go
andreverse_test.go
should be dirtied.