Documentation
¶
Overview ¶
Package compilerservice owns reusable, editor-independent project snapshots. CLI, LSP, and future agent adapters can share overlays, diagnostics, checked artifacts, and language-service contexts without rebuilding compiler phases.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service maintains immutable snapshots over project inputs and unsaved document overlays. Any input change invalidates the current analysis.
func (*Service) Analyze ¶
Analyze returns the current immutable project snapshot. Compilation happens outside the service lock. If inputs change concurrently, the obsolete result is discarded and analysis restarts from the newer generation.
func (*Service) CloseDocument ¶
CloseDocument removes an unsaved overlay and restores the on-disk project unit, if one exists.
func (*Service) RemoveWorkspaceDocument ¶ added in v0.2.6
RemoveWorkspaceDocument removes an on-disk project input while preserving an open editor overlay until the editor closes it.
func (*Service) SetDocument ¶
func (s *Service) SetDocument(unit compiler.SourceUnit)
SetDocument installs an unsaved source unit. Existing project files and new files use the same operation; adapters are responsible for deriving the module and package names of a newly created file.
func (*Service) SetWorkspaceDocument ¶ added in v0.2.6
func (s *Service) SetWorkspaceDocument(unit compiler.SourceUnit)
SetWorkspaceDocument updates the on-disk project input beneath any open editor overlay. Closing an overlay therefore restores the latest saved file.
type Snapshot ¶
type Snapshot struct {
Version uint64
Diagnostics []diagnostic.Diagnostic
Artifacts []*compiler.Artifact
Stale bool
// contains filtered or unexported fields
}