1
0
mirror of https://github.com/golang/go synced 2024-11-19 04:14:45 -07:00
go/internal/lsp/testdata/bad/bad1.go
Ian Cottrell 0522b6e926 internal/lsp: adding the test suite to the source package
Change-Id: Ia287d84186bccca9e74050528daf809cb0e88c46
Reviewed-on: https://go-review.googlesource.com/c/tools/+/176117
Run-TryBot: Ian Cottrell <iancottrell@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-05-10 20:20:41 +00:00

28 lines
1.2 KiB
Go

// +build go1.11
package bad
// import (
// "github.com/bob/pkg" //@diag("\"github.com/bob/pkg\"", "LSP", "unable to import "\"github.com/bob/pkg\"")
// )
var a unknown //@item(global_a, "a", "unknown", "var"),diag("unknown", "LSP", "undeclared name: unknown")
func random() int { //@item(random, "random()", "int", "func")
//@complete("", global_a, bob, random, random2, random3, stuff)
return 0
}
func random2(y int) int { //@item(random2, "random2(y int)", "int", "func"),item(bad_y_param, "y", "int", "parameter")
x := 6 //@item(x, "x", "int", "var"),diag("x", "LSP", "x declared but not used")
var q blah //@item(q, "q", "blah", "var"),diag("q", "LSP", "q declared but not used"),diag("blah", "LSP", "undeclared name: blah")
var t blob //@item(t, "t", "blob", "var"),diag("t", "LSP", "t declared but not used"),diag("blob", "LSP", "undeclared name: blob")
//@complete("", q, t, x, bad_y_param, global_a, bob, random, random2, random3, stuff)
return y
}
func random3(y ...int) { //@item(random3, "random3(y ...int)", "", "func"),item(y_variadic_param, "y", "[]int", "parameter")
//@complete("", y_variadic_param, global_a, bob, random, random2, random3, stuff)
}