1
0
mirror of https://github.com/golang/go synced 2024-11-19 05:34:40 -07:00
go/internal/lsp/testdata/bad
Iskander Sharipov ec14b29651 internal/lsp/source: fix all types in resolveInvalid
This CL teaches lsp to report `**T` instead of `**invalid type`,
`func (badParam) badResult` instead of `func (invalid type) invalid type`, etc.

To do that, we need to detect "invalid type" inside any part of a type.
I've added typeIsValid() function for that.

To simplify type formating code in resolveInvalid(), formatNode
function is added that can also format *ast.StarExpr (of any depth).
Since we already used AST printer in the same file, I
added formatNode function that is now used in both places.
While at it, replaced bytes.Buffer to strings.Builder there.

Change-Id: I3bb84c58c417b175cceefb410e238c48425f7cee
Reviewed-on: https://go-review.googlesource.com/c/tools/+/210357
Run-TryBot: Iskander Sharipov <quasilyte@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
2019-12-11 23:00:51 +00:00
..
bad0.go internal/lsp: refactor error handling code in type-checking 2019-10-21 18:57:46 +00:00
bad1.go internal/lsp/source: fix all types in resolveInvalid 2019-12-11 23:00:51 +00:00
badimport.go internal/lsp: do not close over the handle in the memoize function 2019-10-30 00:30:36 +00:00