Documentation ¶
Index ¶
- Constants
- type DidChangeEvent
- type DidChangeWatchedEvent
- type DidOpenEvent
- type DiscoverEvent
- type EventBus
- func (n *EventBus) DidChange(e DidChangeEvent)
- func (n *EventBus) DidChangeWatched(e DidChangeWatchedEvent)
- func (n *EventBus) DidOpen(e DidOpenEvent)
- func (n *EventBus) Discover(e DiscoverEvent)
- func (n *EventBus) ManifestChange(e ManifestChangeEvent)
- func (n *EventBus) OnDidChange(identifier string, doneChannel <-chan struct{}) <-chan DidChangeEvent
- func (n *EventBus) OnDidChangeWatched(identifier string, doneChannel <-chan struct{}) <-chan DidChangeWatchedEvent
- func (n *EventBus) OnDidOpen(identifier string, doneChannel <-chan struct{}) <-chan DidOpenEvent
- func (n *EventBus) OnDiscover(identifier string, doneChannel <-chan struct{}) <-chan DiscoverEvent
- func (n *EventBus) OnManifestChange(identifier string, doneChannel <-chan struct{}) <-chan ManifestChangeEvent
- func (n *EventBus) OnPluginLockChange(identifier string, doneChannel <-chan struct{}) <-chan PluginLockChangeEvent
- func (n *EventBus) PluginLockChange(e PluginLockChangeEvent)
- func (eb *EventBus) SetLogger(logger *log.Logger)
- type ManifestChangeEvent
- type PluginLockChangeEvent
- type Subscriber
- type Topic
Constants ¶
const ChannelSize = 10
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DidChangeEvent ¶
DidChangeEvent is an event to signal that a file in directory has changed.
It is usually emitted when a document is changed via a language server text synchronization event.
type DidChangeWatchedEvent ¶
type DidChangeWatchedEvent struct { Context context.Context // RawPath contains an OS specific path to the file or directory that was // changed. Usually extracted from the URI. RawPath string // IsDir is true if we were able to determine that the path is a directory. IsDir bool ChangeType protocol.FileChangeType }
DidChangeWatchedEvent is the event that is emitted when a client notifies the language server that a directory or file was changed outside of the editor.
type DidOpenEvent ¶
DidOpenEvent is an event to signal that a directory is open in the editor or important for the language server to process.
It is usually emitted when a document is opened via a language server text synchronization event. It can also be fired from different features to signal that a directory should be processed in other features as well.
type DiscoverEvent ¶
DiscoverEvent is an event that is triggered by the walker when a new directory is walked.
Most features use this to create a state entry if the directory contains files relevant to them.
type EventBus ¶
type EventBus struct {
// contains filtered or unexported fields
}
EventBus is a simple event bus that allows for subscribing to and publishing events of a specific type.
It has a static list of topics. Each topic can have multiple subscribers. When an event is published to a topic, it is sent to all subscribers.
func NewEventBus ¶
func NewEventBus() *EventBus
func (*EventBus) DidChange ¶
func (n *EventBus) DidChange(e DidChangeEvent)
func (*EventBus) DidChangeWatched ¶
func (n *EventBus) DidChangeWatched(e DidChangeWatchedEvent)
func (*EventBus) DidOpen ¶
func (n *EventBus) DidOpen(e DidOpenEvent)
func (*EventBus) Discover ¶
func (n *EventBus) Discover(e DiscoverEvent)
func (*EventBus) ManifestChange ¶
func (n *EventBus) ManifestChange(e ManifestChangeEvent)
func (*EventBus) OnDidChange ¶
func (n *EventBus) OnDidChange(identifier string, doneChannel <-chan struct{}) <-chan DidChangeEvent
func (*EventBus) OnDidChangeWatched ¶
func (n *EventBus) OnDidChangeWatched(identifier string, doneChannel <-chan struct{}) <-chan DidChangeWatchedEvent
func (*EventBus) OnDidOpen ¶
func (n *EventBus) OnDidOpen(identifier string, doneChannel <-chan struct{}) <-chan DidOpenEvent
func (*EventBus) OnDiscover ¶
func (n *EventBus) OnDiscover(identifier string, doneChannel <-chan struct{}) <-chan DiscoverEvent
func (*EventBus) OnManifestChange ¶
func (n *EventBus) OnManifestChange(identifier string, doneChannel <-chan struct{}) <-chan ManifestChangeEvent
func (*EventBus) OnPluginLockChange ¶
func (n *EventBus) OnPluginLockChange(identifier string, doneChannel <-chan struct{}) <-chan PluginLockChangeEvent
func (*EventBus) PluginLockChange ¶
func (n *EventBus) PluginLockChange(e PluginLockChangeEvent)
type ManifestChangeEvent ¶
type ManifestChangeEvent struct { Context context.Context Dir document.DirHandle ChangeType protocol.FileChangeType }
ManifestChangeEvent is an event that should be fired whenever the module manifest file changes.
type PluginLockChangeEvent ¶
type PluginLockChangeEvent struct { Context context.Context Dir document.DirHandle ChangeType protocol.FileChangeType }
PluginLockChangeEvent is an event that should be fired whenever the lock file changes.
type Subscriber ¶
type Subscriber[T any] struct { // contains filtered or unexported fields }
Subscriber represents a subscriber to a topic