Documentation
¶
Index ¶
- type BaseContext
- type CodeActionContext
- type CodeActionProvider
- type CodeActionPublish
- type CompletionContext
- type CompletionProvider
- type CompletionPublish
- type DefinitionContext
- type DefinitionProvider
- type Diagnostic
- type DiagnosticContext
- type DiagnosticProvider
- type DiagnosticPublisher
- type Hover
- type HoverContext
- type HoverProvider
- type HoverPublisher
- type InitContext
- type Language
- type LocationPublisher
- type Manager
- func (m *Manager) Add(providers ...Provider) *Manager
- func (m *Manager) CodeAction(ctx CodeActionContext)
- func (m *Manager) Completion(ctx CompletionContext)
- func (m *Manager) Diagnostics(ctx DiagnosticContext)
- func (m *Manager) Hover(ctx HoverContext)
- func (m *Manager) Init(ctx InitContext)
- func (m *Manager) Register(typ file.Type, provider any)
- func (m *Manager) ResolveDefinition(ctx DefinitionContext)
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseContext ¶
type CodeActionContext ¶
type CodeActionContext struct { BaseContext Range ts.Range Publish CodeActionPublish }
type CodeActionProvider ¶
type CodeActionProvider interface {
ResolveCodeAction(CodeActionContext)
}
Interface that providers that supports code actions can implement.
type CodeActionPublish ¶
type CodeActionPublish func(protocol.CodeAction)
type CompletionContext ¶
type CompletionContext struct { BaseContext // File *parser.File Position ts.Point // Publish a completion item Publish CompletionPublish }
type CompletionProvider ¶
type CompletionProvider interface { // Resolve go to definition ResolveCompletion(CompletionContext) }
Interface that providers that supports completion can implement
type CompletionPublish ¶
type CompletionPublish func(protocol.CompletionItem)
type DefinitionContext ¶
type DefinitionContext struct { BaseContext Position ts.Point // Publish a location Publish LocationPublisher }
type DefinitionProvider ¶
type DefinitionProvider interface { // Resolve go to definition ResolveDefinition(DefinitionContext) }
Interface that providers that supports go to definition can implement
type Diagnostic ¶
type Diagnostic struct { Range ts.Range Severity protocol.DiagnosticSeverity Message string }
type DiagnosticContext ¶
type DiagnosticContext struct { BaseContext Publish DiagnosticPublisher }
type DiagnosticProvider ¶
type DiagnosticProvider interface {
Diagnostic(DiagnosticContext)
}
Interface that providers that supports diagnostics can implement
type DiagnosticPublisher ¶
type DiagnosticPublisher func(Diagnostic)
type HoverContext ¶
type HoverContext struct { BaseContext Position ts.Point Publish HoverPublisher }
type HoverProvider ¶
type HoverProvider interface {
Hover(HoverContext)
}
Interface that providers that supports hover information can implement
type HoverPublisher ¶
type HoverPublisher func(Hover)
type InitContext ¶
type Language ¶
type Language struct { CompletionProviders []CompletionProvider DiagnosticsProviders []DiagnosticProvider DefinitionProviders []DefinitionProvider CodeActionProviders []CodeActionProvider HoverProviders []HoverProvider }
type LocationPublisher ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) CodeAction ¶
func (m *Manager) CodeAction(ctx CodeActionContext)
func (*Manager) Completion ¶
func (m *Manager) Completion(ctx CompletionContext)
func (*Manager) Diagnostics ¶
func (m *Manager) Diagnostics(ctx DiagnosticContext)
func (*Manager) Hover ¶
func (m *Manager) Hover(ctx HoverContext)
func (*Manager) Init ¶
func (m *Manager) Init(ctx InitContext)
func (*Manager) ResolveDefinition ¶
func (m *Manager) ResolveDefinition(ctx DefinitionContext)
type Provider ¶
type Provider interface { Register(manager *Manager) Init(ctx InitContext) }
Click to show internal directories.
Click to hide internal directories.