-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gopls/internal/regtest/marker: port remaining completion tests
The following changes were made to test data: - anon.txt, complit.txt: added additional literal completion results. - errors.txt: copied in part of the 'types' package. As described in CL 538797, porting completion tests is a blocker for zero config gopls. For golang/go#57979 For golang/go#54845 Change-Id: I02a0c15a14ea36bea4ecc55664f95a2d635aaa53 Reviewed-on: https://go-review.googlesource.com/c/tools/+/538800 Reviewed-by: Alan Donovan <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
- Loading branch information
Showing
24 changed files
with
253 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
gopls/internal/regtest/marker/testdata/completion/anon.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
This test checks completion related to anonymous structs. | ||
|
||
-- flags -- | ||
-ignore_extra_diags | ||
|
||
-- settings.json -- | ||
{ | ||
"deepCompletion": false | ||
} | ||
|
||
-- anon.go -- | ||
package anon | ||
|
||
// Literal completion results. | ||
/* int() */ //@item(int, "int()", "int", "var") | ||
|
||
func _() { | ||
for _, _ := range []struct { | ||
i, j int //@item(anonI, "i", "int", "field"),item(anonJ, "j", "int", "field") | ||
}{ | ||
{ | ||
i: 1, | ||
//@complete("", anonJ) | ||
}, | ||
{ | ||
//@complete("", anonI, anonJ, int) | ||
}, | ||
} { | ||
continue | ||
} | ||
|
||
s := struct{ f int }{ } //@item(anonF, "f", "int", "field"),item(structS, "s", "struct{...}", "var"),complete(" }", anonF, int) | ||
|
||
_ = map[struct{ x int }]int{ //@item(anonX, "x", "int", "field") | ||
struct{ x int }{ }: 1, //@complete(" }", anonX, int, structS) | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...nternal/lsp/testdata/basiclit/basiclit.go → .../marker/testdata/completion/basic_lit.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
.../internal/lsp/testdata/channel/channel.go → ...st/marker/testdata/completion/channel.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...nternal/lsp/testdata/constant/constant.go → ...t/marker/testdata/completion/constant.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
gopls/internal/regtest/marker/testdata/completion/errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
This test checks completion related to errors. | ||
|
||
-- flags -- | ||
-ignore_extra_diags | ||
|
||
-- settings.json -- | ||
{ | ||
"deepCompletion": false | ||
} | ||
|
||
-- go.mod -- | ||
module golang.org/lsptests | ||
|
||
go 1.18 | ||
|
||
-- errors.go -- | ||
package errors | ||
|
||
import ( | ||
"golang.org/lsptests/types" | ||
) | ||
|
||
func _() { | ||
bob.Bob() //@complete(".") | ||
types.b //@complete(" //", Bob_interface) | ||
} | ||
|
||
-- types/types.go -- | ||
package types | ||
|
||
type Bob interface { //@item(Bob_interface, "Bob", "interface{...}", "interface") | ||
Bobby() | ||
} |
Oops, something went wrong.