Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes golang/go #67920 #66861 #501

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions gopls/internal/doc/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,6 @@
"Status": "experimental",
"Hierarchy": "build"
},
{
"Name": "allowImplicitNetworkAccess",
"Type": "bool",
"Doc": "allowImplicitNetworkAccess disables GOPROXY=off, allowing implicit module\ndownloads rather than requiring user action. This option will eventually\nbe removed.\n",
"EnumKeys": {
"ValueType": "",
"Keys": null
},
"EnumValues": null,
"Default": "false",
"Status": "experimental",
"Hierarchy": "build"
},
{
"Name": "standaloneTags",
"Type": "[]string",
Expand Down
18 changes: 15 additions & 3 deletions gopls/internal/golang/code_lens.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ func runTestCodeLens(ctx context.Context, snapshot *cache.Snapshot, fh file.Hand
}
puri := fh.URI()
for _, fn := range testFuncs {
cmd, err := command.NewTestCommand("run test", puri, []string{fn.name}, nil)
cmd, err := command.NewRunTestsCommand("run test", command.RunTestsArgs{
URI: puri,
Tests: []string{fn.name},
Benchmarks: nil,
})
if err != nil {
return nil, err
}
Expand All @@ -57,7 +61,11 @@ func runTestCodeLens(ctx context.Context, snapshot *cache.Snapshot, fh file.Hand
}

for _, fn := range benchFuncs {
cmd, err := command.NewTestCommand("run benchmark", puri, nil, []string{fn.name})
cmd, err := command.NewRunTestsCommand("run benchmark", command.RunTestsArgs{
URI: puri,
Tests: nil,
Benchmarks: []string{fn.name},
})
if err != nil {
return nil, err
}
Expand All @@ -79,7 +87,11 @@ func runTestCodeLens(ctx context.Context, snapshot *cache.Snapshot, fh file.Hand
for _, fn := range benchFuncs {
benches = append(benches, fn.name)
}
cmd, err := command.NewTestCommand("run file benchmarks", puri, nil, benches)
cmd, err := command.NewRunTestsCommand("run file benchmarks", command.RunTestsArgs{
URI: puri,
Tests: nil,
Benchmarks: benches,
})
if err != nil {
return nil, err
}
Expand Down
6 changes: 5 additions & 1 deletion gopls/internal/golang/codeaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,11 @@ func getGoTestCodeActions(pkg *cache.Package, pgf *parsego.File, rng protocol.Ra
return nil, nil
}

cmd, err := command.NewTestCommand("Run tests and benchmarks", pgf.URI, tests, benchmarks)
cmd, err := command.NewRunTestsCommand("Run tests and benchmarks", command.RunTestsArgs{
URI: pgf.URI,
Tests: tests,
Benchmarks: benchmarks,
})
if err != nil {
return nil, err
}
Expand Down
22 changes: 0 additions & 22 deletions gopls/internal/protocol/command/command_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions gopls/internal/protocol/command/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,6 @@ type Interface interface {
// Applies a fix to a region of source code.
ApplyFix(context.Context, ApplyFixArgs) (*protocol.WorkspaceEdit, error)

// Test: Run test(s) (legacy)
//
// Runs `go test` for a specific set of test or benchmark functions.
//
// This command is asynchronous; wait for the 'end' progress notification.
//
// This command is an alias for RunTests; the only difference
// is the form of the parameters.
//
// TODO(adonovan): eliminate it.
Test(context.Context, protocol.DocumentURI, []string, []string) error

// Test: Run test(s)
//
// Runs `go test` for a specific set of test or benchmark functions.
Expand Down
6 changes: 0 additions & 6 deletions gopls/internal/settings/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -1053,12 +1053,6 @@ func (o *Options) set(name string, value any, seen map[string]struct{}) error {
case "analysisProgressReporting":
return setBool(&o.AnalysisProgressReporting, value)

case "allowImplicitNetworkAccess":
if err := setBool(&o.AllowImplicitNetworkAccess, value); err != nil {
return err
}
return softErrorf("gopls setting \"allowImplicitNetworkAccess\" is deprecated.\nPlease comment on https://go.dev/issue/66861 if this impacts your workflow.")

case "standaloneTags":
return setStringSlice(&o.StandaloneTags, value)

Expand Down
2 changes: 0 additions & 2 deletions gopls/internal/test/integration/misc/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ func TestDeprecatedSettings(t *testing.T) {
"experimentalWorkspaceModule": true,
"tempModfile": true,
"allowModfileModifications": true,
"allowImplicitNetworkAccess": true,
},
).Run(t, "", func(t *testing.T, env *Env) {
env.OnceMet(
Expand All @@ -249,7 +248,6 @@ func TestDeprecatedSettings(t *testing.T) {
ShownMessage("experimentalWatchedFileDelay"),
ShownMessage("tempModfile"),
ShownMessage("allowModfileModifications"),
ShownMessage("allowImplicitNetworkAccess"),
)
})
}