Provisional API: This reference documents current compiler behavior. Compatibility is not yet promised.
src/sourceview.x
Request-owned source overlays.
Functions
| Function | Summary |
|---|---|
SourceView.exists | Returns readable-file presence, including unsaved new files. |
SourceView.init | Initializes empty overlays in the current request lifetime. |
SourceView.is_changed | Returns whether this logical file has an unsaved overlay. |
SourceView.read | Reads through the request overlay, falling back to a regular disk file. |
SourceView.set | Stores an immutable snapshot under its logical source path. |
SourceView
SourceView.exists
int SourceView.exists(SourceView sources, String path)
Returns readable-file presence, including unsaved new files.
Source: src/sourceview.x:46
SourceView.init
void SourceView.init(SourceView sources)
Initializes empty overlays in the current request lifetime.
Source: src/sourceview.x:28
SourceView.is_changed
int SourceView.is_changed(SourceView sources, String path)
Returns whether this logical file has an unsaved overlay.
Source: src/sourceview.x:42
SourceView.read
int SourceView.read(SourceView sources, String path, String volatile &text)
Reads through the request overlay, falling back to a regular disk file. The return value distinguishes an empty file from a failed read. Disk text belongs to the calling unit; configured snapshots remain borrowed.
Source: src/sourceview.x:56
SourceView.set
void SourceView.set(SourceView s, String path, String text, int changed)
Stores an immutable snapshot under its logical source path. Empty text is a present snapshot, not a request to fall back to the disk file.
Source: src/sourceview.x:36
Public types
| Type | Kind | Summary |
|---|---|---|
SourceView | class | Owns configured immutable overlays in the request’s active Context. |
SourceView
class SourceView struct { Map overlays, dirty_paths; } *
Owns configured immutable overlays in the request’s active Context. A frontend and its units borrow this view. Text read from disk belongs to the reading unit, so the view never caches that shorter-lived text.
Source: src/sourceview.x:17
Design notes
Logical paths keep their identity when an editor supplies unsaved text. Configure this view before opening a frontend unit; its immutable values and Map must outlive every compiler borrowing it.