Documentation
¶
Index ¶
- type FileEvent
- type MockLSPClient
- func (m *MockLSPClient) CountEvents(uri string, eventType protocol.FileChangeType) int
- func (m *MockLSPClient) DidChangeWatchedFiles(ctx context.Context, params protocol.DidChangeWatchedFilesParams) error
- func (m *MockLSPClient) GetEvents() []FileEvent
- func (m *MockLSPClient) IsFileOpen(path string) bool
- func (m *MockLSPClient) NotifyChange(ctx context.Context, path string) error
- func (m *MockLSPClient) OpenFile(ctx context.Context, path string) error
- func (m *MockLSPClient) ResetEvents()
- func (m *MockLSPClient) WaitForEvent(ctx context.Context) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileEvent ¶
type FileEvent struct { URI string Type protocol.FileChangeType }
FileEvent represents a file event notification
type MockLSPClient ¶
type MockLSPClient struct {
// contains filtered or unexported fields
}
MockLSPClient implements the watcher.LSPClient interface for testing
func NewMockLSPClient ¶
func NewMockLSPClient() *MockLSPClient
NewMockLSPClient creates a new mock LSP client for testing
func (*MockLSPClient) CountEvents ¶
func (m *MockLSPClient) CountEvents(uri string, eventType protocol.FileChangeType) int
CountEvents counts events for a specific file and event type
func (*MockLSPClient) DidChangeWatchedFiles ¶
func (m *MockLSPClient) DidChangeWatchedFiles(ctx context.Context, params protocol.DidChangeWatchedFilesParams) error
DidChangeWatchedFiles mocks sending watched file events to the server
func (*MockLSPClient) GetEvents ¶
func (m *MockLSPClient) GetEvents() []FileEvent
GetEvents returns a copy of all recorded events
func (*MockLSPClient) IsFileOpen ¶
func (m *MockLSPClient) IsFileOpen(path string) bool
IsFileOpen checks if a file is already open in the editor
func (*MockLSPClient) NotifyChange ¶
func (m *MockLSPClient) NotifyChange(ctx context.Context, path string) error
NotifyChange mocks notifying the server of a file change
func (*MockLSPClient) OpenFile ¶
func (m *MockLSPClient) OpenFile(ctx context.Context, path string) error
OpenFile mocks opening a file in the editor
func (*MockLSPClient) ResetEvents ¶
func (m *MockLSPClient) ResetEvents()
ResetEvents clears the recorded events
func (*MockLSPClient) WaitForEvent ¶
func (m *MockLSPClient) WaitForEvent(ctx context.Context) bool
WaitForEvent waits for at least one event to be received or context to be done