Skip to content

Commit be02aa1

Browse files
committed
[release] test/gopls: fix completion middleware test
gopls v0.5.0 seems to change the completion result ranking, so the test that checked a specific entry for the most plausible result is broken. This CL made the test use a more specific query (fmt.P<> instead of fmt.<>) so the test can pass with gopls 0.4.x and 0.5.0. Probably, it's better to just check whether the desirable entry is in one of the top k results where k is a reasonablly small but larger than 1. I don't know what's a good number yet. Fixes #649 Change-Id: I805b2f1b2c4ae6dde19f6a931434b46fb0954510 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/255119 Trust: Hyang-Ah Hana Kim <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Rebecca Stambler <[email protected]> (cherry picked from commit 5879a3e) Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/255120
1 parent bbadf55 commit be02aa1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/gopls/extension.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ suite('Go Extension Tests With Gopls', function () {
189189
await env.reset('gogetdocTestData');
190190
const { uri } = await env.openDoc('test.go');
191191
const testCases: [string, vscode.Position, string][] = [
192-
['fmt.<>', new vscode.Position(19, 5), 'Formatter'],
192+
['fmt.P<>', new vscode.Position(19, 6), 'Print'],
193193
];
194194
for (const [name, position, wantFilterText] of testCases) {
195195
let list: vscode.CompletionList<vscode.CompletionItem>;

0 commit comments

Comments
 (0)