Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NewParams ¶
type NewParams struct {
TemplDocHandler TemplDocHandler
OpenDocSources map[string]string
}
NewParams specifies the parameters necessary to create a new lazy loader.
type TemplDocHandler ¶
type TemplDocHandler interface {
HandleDidOpen(ctx context.Context, params *lsp.DidOpenTextDocumentParams) error
HandleDidClose(ctx context.Context, params *lsp.DidCloseTextDocumentParams) error
}
type TemplDocLazyLoader ¶
type TemplDocLazyLoader interface {
// Load loads a templ document and its dependencies.
Load(ctx context.Context, params *lsp.DidOpenTextDocumentParams) error
// Sync syncs the dependencies of a templ document using the changes made to the document.
Sync(ctx context.Context, params *lsp.DidChangeTextDocumentParams) error
// Unload unloads a templ document and its dependencies.
Unload(ctx context.Context, params *lsp.DidCloseTextDocumentParams) error
// HasLoaded reports whether a templ document and its dependencies have been loaded.
HasLoaded(doc lsp.TextDocumentIdentifier) bool
}
TemplDocLazyLoader lazily loads templ documents as necessary.
func New ¶
func New(params NewParams) TemplDocLazyLoader
New creates a new lazy loader using the provided arguments.
Click to show internal directories.
Click to hide internal directories.