# Packages
The bench package implements benchmarks for various LSP operations.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Package fake provides a fake implementation of an LSP-enabled text editor, its LSP client plugin, and a Sandbox environment for use in integration tests.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
AllOf expects that all given expectations are met.
AnyOf returns an expectation that is satisfied when any of the given expectations is met.
AtPosition filters to diagnostics at location name:line:character, for a sandbox-relative path name.
CapabilitiesJSON sets the capabalities json.
ClientName sets the LSP client name.
CompletedProgress expects that there is exactly one workDone progress with the given title, and is satisfied when that progress completes.
CompletedProgressToken expects that workDone progress is complete for the given progress token.
CompletedWork expects a work item to have been completed >= atLeast times.
ConnectGoplsEnv creates a new Gopls environment for the given sandbox, editor config, and server connector.
DefaultModes returns the default modes to run for each regression test (they may be reconfigured by the tests themselves).
DelayMessages can be used to fuzz message delivery delays for the purpose of reproducing test flakes.
Diagnostics asserts that there is at least one diagnostic matching the given filters.
FakeGoPackagesDriver configures gopls to run with a fake GOPACKAGESDRIVER environment variable.
FileWatchMatching expects that a file registration matches re.
FilterToolchainPathAndGOROOT updates the PATH and GOROOT environment variables for the current process to effectively revert the changes made by the go command when performing a toolchain switch in the context of `go test` (see golang/go#68005).
ForFile filters to diagnostics matching the sandbox-relative file name.
FromSource filters to diagnostics matching the given diagnostics source.
IgnoreTelemetryPromptWork may be used in conjunction with NoOutStandingWork to ignore the telemetry prompt.
InGOPATH configures the workspace working directory to be GOPATH, rather than a separate working directory for use with modules.
LogMatching asserts that the client has received a log message of type typ matching the regexp re a certain number of times.
Main sets up and tears down the shared integration test state.
MessageResponder configures the editor to respond to window/showMessageRequest messages using the provided function.
Modes configures the execution modes that the test should run in.
No description provided by the author
NoDiagnostics asserts that there are no diagnostics matching the given filters.
NoErrorLogs asserts that the client has not received any log messages of error severity.
NoFileWatchMatching expects that no file registration matches re.
NoLogMatching asserts that the client has not received a log message of type typ matching the regexp re.
NoLogsOnError turns off dumping the LSP logs on test failures.
NoOutstandingWork asserts that there is no work initiated using the LSP $/progress API that has not completed.
NoShownMessage asserts that the editor has not received a ShowMessage.
Not inverts the sense of an expectation: a met expectation is unmet, and an unmet expectation is met.
OnceMet returns an Expectation that, once the precondition is met, asserts that mustMeet is met.
OutstandingWork expects a work item to be outstanding.
ProxyFiles configures a file proxy using the given txtar-encoded string.
ReadAllDiagnostics is an expectation that stores all published diagnostics into the provided map, whenever it is evaluated.
ReadDiagnostics is an Expectation that stores the current diagnostics for fileName in into, whenever it is evaluated.
No description provided by the author
ShownDocument asserts that the client has received a ShowDocumentRequest for the given URI.
ShownDocuments is an expectation that appends each showDocument request into the provided slice, whenever it is evaluated.
ShownMessage asserts that the editor has received a ShowMessageRequest containing the given substring.
ShownMessageRequest asserts that the editor has received a ShowMessageRequest with message matching the given regular expression.
StartedWork expect a work item to have been started >= atLeast times.
WindowsLineEndings configures the editor to use windows line endings.
WithMessage filters to diagnostics whose message contains the given substring.
No description provided by the author
WithSeverityTags filters to diagnostics whose severity and tags match the given expectation.
WorkspaceFolders configures the workdir-relative workspace folders or uri to send to the LSP server.
WriteGoSum causes the environment to write a go.sum file for the requested relative directories (via `go list -mod=mod`), before starting gopls.
# Constants
Default mode runs gopls with the default options, communicating over pipes to emulate the lsp sidecar execution mode, which communicates over stdin/stdout.
Forwarded uses the default options, but forwards connections to a shared in-process gopls server.
Met indicates that an expectation is satisfied by the current state.
SeparateProcess uses the default options, but forwards connection to an external gopls daemon.
Unmeetable indicates that an expectation cannot be satisfied in the future.
Unmet indicates that an expectation is not currently met, but could be met in the future.
# Variables
InitialWorkspaceLoad is an expectation that the workspace initial load has completed.
# Structs
An Awaiter keeps track of relevant LSP state, so that it may be asserted upon with Expectations.
A DiagnosticFilter filters the set of diagnostics, for assertion with Diagnostics or NoDiagnostics.
Env holds the building blocks of an editor testing environment, providing wrapper methods that hide the boilerplate of plumbing contexts and checking errors.
An Expectation is an expected property of the state of the LSP client.
A Runner runs tests in gopls execution environments, as specified by its modes.
State encapsulates the server state TODO: explain more.
No description provided by the author
# Interfaces
A RunOption augments the behavior of the test runner.
# Type aliases
EnvVars sets environment variables for the LSP session.
FolderSettings defines per-folder workspace settings, keyed by relative path to the folder.
Mode is a bitmask that defines for which execution modes a test should run.
RunMultiple runs a test multiple times, with different options.
Settings sets user-provided configuration for the LSP server.
No description provided by the author
A Verdict is the result of checking an expectation against the current editor state.