notification

package
v0.0.0-...-1fb2453 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockNotifier

type MockNotifier struct {
	// contains filtered or unexported fields
}

func NewMockNotifier

func NewMockNotifier() *MockNotifier

func (*MockNotifier) CreateListener

func (m *MockNotifier) CreateListener(_ func(params any))

func (*MockNotifier) DisposeListener

func (m *MockNotifier) DisposeListener()

func (*MockNotifier) Receive

func (m *MockNotifier) Receive() (payload any, stop bool)

func (*MockNotifier) Send

func (m *MockNotifier) Send(msg any)

func (*MockNotifier) SendCount

func (m *MockNotifier) SendCount() int

func (*MockNotifier) SendError

func (m *MockNotifier) SendError(err error)

func (*MockNotifier) SendErrorCount

func (m *MockNotifier) SendErrorCount() int

func (*MockNotifier) SendErrorDiagnostic

func (m *MockNotifier) SendErrorDiagnostic(path string, err error)

func (*MockNotifier) SendErrorDiagnosticCount

func (m *MockNotifier) SendErrorDiagnosticCount() int

func (*MockNotifier) SendShowMessage

func (m *MockNotifier) SendShowMessage(messageType sglsp.MessageType, message string)

func (*MockNotifier) SendShowMessageCount

func (m *MockNotifier) SendShowMessageCount() int

func (*MockNotifier) SentMessages

func (m *MockNotifier) SentMessages() []any

type Notifier

type Notifier interface {
	SendShowMessage(messageType sglsp.MessageType, message string)
	Send(msg any)
	SendError(err error)
	SendErrorDiagnostic(path string, err error)
	Receive() (payload any, stop bool)
	CreateListener(callback func(params any))
	DisposeListener()
}

Notifier should be passed as a dependency to the types that call "notification.x" functions. This allows using mocks and enables us to gradually refactor out the direct calls to the "notification" package functions.

func NewNotifier

func NewNotifier() Notifier

Jump to

Keyboard shortcuts

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