type runConfig … func defaultConfig() runConfig { … } type RunOption … type optionSetter … func (f optionSetter) set(opts *runConfig) { … } // ProxyFiles configures a file proxy using the given txtar-encoded string. func ProxyFiles(txt string) RunOption { … } // WriteGoSum causes the environment to write a go.sum file for the requested // relative directories (via `go list -mod=mod`), before starting gopls. // // Useful for tests that use ProxyFiles, but don't care about crafting the // go.sum content. func WriteGoSum(dirs ...string) RunOption { … } // Modes configures the execution modes that the test should run in. // // By default, modes are configured by the test runner. If this option is set, // it overrides the set of default modes and the test runs in exactly these // modes. func Modes(modes Mode) RunOption { … } // NoLogsOnError turns off dumping the LSP logs on test failures. func NoLogsOnError() RunOption { … } // WindowsLineEndings configures the editor to use windows line endings. func WindowsLineEndings() RunOption { … } // ClientName sets the LSP client name. func ClientName(name string) RunOption { … } // CapabilitiesJSON sets the capabalities json. func CapabilitiesJSON(capabilities []byte) RunOption { … } type Settings … func (s Settings) set(opts *runConfig) { … } // WorkspaceFolders configures the workdir-relative workspace folders or uri // to send to the LSP server. By default the editor sends a single workspace folder // corresponding to the workdir root. To explicitly configure no workspace // folders, use WorkspaceFolders with no arguments. func WorkspaceFolders(relFolders ...string) RunOption { … } type FolderSettings … func (fs FolderSettings) set(opts *runConfig) { … } type EnvVars … func (e EnvVars) set(opts *runConfig) { … } // FakeGoPackagesDriver configures gopls to run with a fake GOPACKAGESDRIVER // environment variable. func FakeGoPackagesDriver(t *testing.T) RunOption { … } // InGOPATH configures the workspace working directory to be GOPATH, rather // than a separate working directory for use with modules. func InGOPATH() RunOption { … } // MessageResponder configures the editor to respond to // window/showMessageRequest messages using the provided function. func MessageResponder(f func(*protocol.ShowMessageRequestParams) (*protocol.MessageActionItem, error)) RunOption { … } // DelayMessages can be used to fuzz message delivery delays for the purpose of // reproducing test flakes. // // (Even though this option may be unused, keep it around to aid in debugging // future flakes.) func DelayMessages(upto time.Duration) RunOption { … }