-
Notifications
You must be signed in to change notification settings - Fork 844
smoke test
Before releasing a new version of the extension, please run the following smoke test to make sure that all features are working.
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/golangThen,
cd $GOPATH/src/github.com/golang
git clone https://github.com/golang/example
cd exampleNext, build and sideload the modified Go extension and open the example/hello directory. Open hello.go.
- 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.
- Trigger autocompletion (Ctrl+Space) after
fmt.. - Trigger autocompletion (Ctrl+Space) after
stringutil.. - Enter a newline in the
mainfunction and typefmt.. - Enter a newline in the
mainfunction and typeparser.. Expect suggestions from the unimported standard librarygo/parserpackage. - Enter a newline in the
mainfunction and typefmt.. Select thefmt.Printlncompletion and observe the outcome. Toggle thego.useCodeSnippetsOnFunctionSuggestsetting 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.
Enable go.buildOnSave, go.vetOnSave, and go.lintOnSave.
-
Add
var x intto themainfunction 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.
- Hit enter 3 times in the
mainfunction 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 Importcommand works (add"archive/tar").
-
Add the following to the
mainfunction, then renamextoy.var x int fmt.Println(x)
-
Rename
stringutil.Reverse.reverse.goandreverse_test.goshould be dirtied.
✏️ Want to contribute to this wiki?
Update the source and send a PR.