Help us shape the future of Go! Take the 2026 Go Developer Survey

lazyloader

package
v0.3.1100 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 13 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL