diagnostics

package
v1.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DocumentContext

type DocumentContext struct {
	Ctx         context.Context
	URI         lsp.DocumentURI
	Diagnostics []lsp.Diagnostic
}

DocumentContext contains data about the document on which we have performed the diagnostics on.

type Notifier

type Notifier struct {
	SessionCtx       context.Context
	TSCDocs          chan DocumentContext
	CloseTSCDocsOnce sync.Once
}

Notifier contains a channel representing TSC documents with diagnostics, as well as methods for publishing new diagnostics.

func NewNotifier

func NewNotifier(sessionCtx context.Context, logger *log.Logger) *Notifier

NewNotifier creates a new Notifier instance for running a goroutine that sends out diagnostics to all documents in the channel.

func (*Notifier) Diagnose

func (n *Notifier) Diagnose(ctx context.Context, uri lsp.DocumentURI, diagnostics []lsp.Diagnostic)

Diagnose will enqueue a document and a slice of diagnostics for publishing. Notifications will be delivered in the order of the queue.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL