1
0
mirror of https://github.com/golang/go synced 2024-11-06 19:56:15 -07:00
go/internal/lsp/testdata/funcsig/func_sig.go
Muir Manders 2e68ad74ea internal/lsp: fix scope of FuncType completion candidates
Fix objects defined in the function signature to only be completable
inside the function body. For example:

func (dog Dog) bark(d<>) { // Don't complete <> to "dog".
  d<> // Do complete <> to "dog".
}

Change-Id: Ic9a2dc2ce6771212780f2d6af2221a67d203f35f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/196559
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-09-25 19:53:33 +00:00

10 lines
260 B
Go

package funcsig
type someType int //@item(sigSomeType, "someType", "int", "type")
// Don't complete "foo" in signature.
func (foo someType) _() { //@item(sigFoo, "foo", "someType", "var"),complete(") {", sigSomeType)
//@complete("", sigFoo, sigSomeType)
}