gotools/gopls/internal/test/integration/env.go

type Env

type Awaiter

func NewAwaiter(workdir *fake.Workdir) *Awaiter {}

// Hooks returns LSP client hooks required for awaiting asynchronous expectations.
func (a *Awaiter) Hooks() fake.ClientHooks {}

// ResetShownDocuments resets the set of accumulated ShownDocuments seen so far.
func (a *Awaiter) ResetShownDocuments() {}

type State

type workProgress

// This method, provided for debugging, accesses mutable fields without a lock,
// so it must not be called concurrent with any State mutation.
func (s State) String() string {}

type condition

func (a *Awaiter) onDiagnostics(_ context.Context, d *protocol.PublishDiagnosticsParams) error {}

func (a *Awaiter) onShowDocument(_ context.Context, params *protocol.ShowDocumentParams) error {}

func (a *Awaiter) onShowMessage(_ context.Context, m *protocol.ShowMessageParams) error {}

func (a *Awaiter) onShowMessageRequest(_ context.Context, m *protocol.ShowMessageRequestParams) error {}

func (a *Awaiter) onLogMessage(_ context.Context, m *protocol.LogMessageParams) error {}

func (a *Awaiter) onWorkDoneProgressCreate(_ context.Context, m *protocol.WorkDoneProgressCreateParams) error {}

func (a *Awaiter) onProgress(_ context.Context, m *protocol.ProgressParams) error {}

func (a *Awaiter) onRegisterCapability(_ context.Context, m *protocol.RegistrationParams) error {}

func (a *Awaiter) onUnregisterCapability(_ context.Context, m *protocol.UnregistrationParams) error {}

func (a *Awaiter) checkConditionsLocked() {}

// checkExpectations reports whether s meets all expectations.
func checkExpectations(s State, expectations []Expectation) (Verdict, string) {}

// Await blocks until the given expectations are all simultaneously met.
//
// Generally speaking Await should be avoided because it blocks indefinitely if
// gopls ends up in a state where the expectations are never going to be met.
// Use AfterChange or OnceMet instead, so that the runner knows when to stop
// waiting.
func (e *Env) Await(expectations ...Expectation) {}

// OnceMet blocks until the precondition is met by the state or becomes
// unmeetable. If it was met, OnceMet checks that the state meets all
// expectations in mustMeets.
func (e *Env) OnceMet(precondition Expectation, mustMeets ...Expectation) {}

// Await waits for all expectations to simultaneously be met. It should only be
// called from the main test goroutine.
func (a *Awaiter) Await(ctx context.Context, expectations ...Expectation) error {}