Skip to content

Commit 20da28f

Browse files
h9jianggopherbot
authored andcommitted
extension/test: move codelens test with invalid name to separate module
Go1.24 change go vet causing the test in codelens_test.go failure. The failure is caused by codelens2_test.go's function name, including: - ExampleFunction refers to unknown identifier - Test has malformed name: first letter after 'Test' must not be lowercase. See https://tip.golang.org/doc/go1.24#vet codelens2_test.go indirectly causes failures when codelens_test.go is debuged. Remove unused LSPAny from vscode-languageserver-node. Change-Id: I111f46b5659e2fec968fb71f62e632dfea1ec133 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/649475 Reviewed-by: Hyang-Ah Hana Kim <[email protected]> Auto-Submit: Hongxiang Jiang <[email protected]> Reviewed-by: Robert Findley <[email protected]> kokoro-CI: kokoro <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 05a7746 commit 20da28f

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

extension/src/language/goLanguageServer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import path = require('path');
1414
import semver = require('semver');
1515
import util = require('util');
1616
import vscode = require('vscode');
17-
import { InitializeParams, LSPAny, LSPObject } from 'vscode-languageserver-protocol';
17+
import { InitializeParams, LSPObject } from 'vscode-languageserver-protocol';
1818
import {
1919
CancellationToken,
2020
CloseAction,

extension/test/gopls/codelens.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ suite('Code lenses for testing and benchmarking', function () {
145145

146146
test('Test codelenses include only valid test function names', async () => {
147147
const codeLensProvider = new GoRunTestCodeLensProvider(env.goCtx);
148-
const uri = vscode.Uri.file(path.join(testdataDir, 'codelens2_test.go'));
148+
const uri = vscode.Uri.file(path.join(testdataDir, 'testnames', 'testnames_test.go'));
149149
const benchmarkDocument = await vscode.workspace.openTextDocument(uri);
150150
const codeLenses = await codeLensProvider.provideCodeLenses(benchmarkDocument, cancellationTokenSource.token);
151151
assert.equal(codeLenses.length, 20, JSON.stringify(codeLenses, null, 2));

extension/test/gopls/goTest.run.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ suite('Go Test Runner', () => {
7474
let stub: sinon.SinonStub<[testUtils.TestConfig], Promise<boolean>>;
7575

7676
suiteSetup(async () => {
77-
uri = Uri.file(path.join(fixtureDir, 'codelens', 'codelens2_test.go'));
77+
uri = Uri.file(path.join(fixtureDir, 'codelens', 'testnames', 'testnames_test.go'));
7878
await env.startGopls(uri.fsPath);
7979
testExplorer = GoTestExplorer.new(ctx, env.goCtx);
8080
ctx.subscriptions.push(testExplorer);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/microsoft/vscode-go/gofixtures/subtests
2+
3+
go 1.14

extension/test/testdata/codelens/codelens2_test.go renamed to extension/test/testdata/codelens/testnames/testnames_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"testing"
66
)
77

8-
// As of Go1.16, `go test codelens2_test.go -list .` returns
8+
// As of Go1.16, `go test testnames_test.go -list .` returns
99
// TestFunction
1010
// Test1Function
1111
// TestΣυνάρτηση

0 commit comments

Comments
 (0)