diff --git a/gopls/internal/doc/api.json b/gopls/internal/doc/api.json index 92f5b13f8a1..1f4f8eb5695 100644 --- a/gopls/internal/doc/api.json +++ b/gopls/internal/doc/api.json @@ -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", diff --git a/gopls/internal/golang/code_lens.go b/gopls/internal/golang/code_lens.go index a4aab3e16b0..5426ace0f71 100644 --- a/gopls/internal/golang/code_lens.go +++ b/gopls/internal/golang/code_lens.go @@ -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 } @@ -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 } @@ -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 } diff --git a/gopls/internal/golang/codeaction.go b/gopls/internal/golang/codeaction.go index fa9cb155d4d..ab946b14cdc 100644 --- a/gopls/internal/golang/codeaction.go +++ b/gopls/internal/golang/codeaction.go @@ -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 } diff --git a/gopls/internal/protocol/command/command_gen.go b/gopls/internal/protocol/command/command_gen.go index ee937fc99ab..f56ac37199d 100644 --- a/gopls/internal/protocol/command/command_gen.go +++ b/gopls/internal/protocol/command/command_gen.go @@ -53,7 +53,6 @@ const ( StartDebugging Command = "gopls.start_debugging" StartProfile Command = "gopls.start_profile" StopProfile Command = "gopls.stop_profile" - Test Command = "gopls.test" Tidy Command = "gopls.tidy" ToggleGCDetails Command = "gopls.toggle_gc_details" UpdateGoSum Command = "gopls.update_go_sum" @@ -93,7 +92,6 @@ var Commands = []Command{ StartDebugging, StartProfile, StopProfile, - Test, Tidy, ToggleGCDetails, UpdateGoSum, @@ -270,14 +268,6 @@ func Dispatch(ctx context.Context, params *protocol.ExecuteCommandParams, s Inte return nil, err } return s.StopProfile(ctx, a0) - case Test: - var a0 protocol.DocumentURI - var a1 []string - var a2 []string - if err := UnmarshalArgs(params.Arguments, &a0, &a1, &a2); err != nil { - return nil, err - } - return nil, s.Test(ctx, a0, a1, a2) case Tidy: var a0 URIArgs if err := UnmarshalArgs(params.Arguments, &a0); err != nil { @@ -649,18 +639,6 @@ func NewStopProfileCommand(title string, a0 StopProfileArgs) (protocol.Command, }, nil } -func NewTestCommand(title string, a0 protocol.DocumentURI, a1 []string, a2 []string) (protocol.Command, error) { - args, err := MarshalArgs(a0, a1, a2) - if err != nil { - return protocol.Command{}, err - } - return protocol.Command{ - Title: title, - Command: Test.String(), - Arguments: args, - }, nil -} - func NewTidyCommand(title string, a0 URIArgs) (protocol.Command, error) { args, err := MarshalArgs(a0) if err != nil { diff --git a/gopls/internal/protocol/command/interface.go b/gopls/internal/protocol/command/interface.go index 54694c064b5..bd2ebf97a1f 100644 --- a/gopls/internal/protocol/command/interface.go +++ b/gopls/internal/protocol/command/interface.go @@ -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. diff --git a/gopls/internal/settings/settings.go b/gopls/internal/settings/settings.go index 844c7a5565e..14560c8b7f6 100644 --- a/gopls/internal/settings/settings.go +++ b/gopls/internal/settings/settings.go @@ -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) diff --git a/gopls/internal/test/integration/misc/configuration_test.go b/gopls/internal/test/integration/misc/configuration_test.go index e96fe5dd806..d33261ee10a 100644 --- a/gopls/internal/test/integration/misc/configuration_test.go +++ b/gopls/internal/test/integration/misc/configuration_test.go @@ -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( @@ -249,7 +248,6 @@ func TestDeprecatedSettings(t *testing.T) { ShownMessage("experimentalWatchedFileDelay"), ShownMessage("tempModfile"), ShownMessage("allowModfileModifications"), - ShownMessage("allowImplicitNetworkAccess"), ) }) }