Documentation ¶
Index ¶
- type MockNotifier
- func (m *MockNotifier) CreateListener(_ func(params any))
- func (m *MockNotifier) DisposeListener()
- func (m *MockNotifier) Receive() (payload any, stop bool)
- func (m *MockNotifier) Send(msg any)
- func (m *MockNotifier) SendCount() int
- func (m *MockNotifier) SendError(err error)
- func (m *MockNotifier) SendErrorCount() int
- func (m *MockNotifier) SendErrorDiagnostic(path string, err error)
- func (m *MockNotifier) SendErrorDiagnosticCount() int
- func (m *MockNotifier) SendShowMessage(messageType sglsp.MessageType, message string)
- func (m *MockNotifier) SendShowMessageCount() int
- func (m *MockNotifier) SentMessages() []any
- type Notifier
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
Click to show internal directories.
Click to hide internal directories.