Skip to main content

Module source_overlay

Module source_overlay 

Source
Expand description

#2471: an in-memory overlay of unsaved editor buffers for a build.

bynkc compile --sources-stdin reads a JSON object { "<absolute path>": "<text>" } from stdin and layers it over the sources the build reads from disk, so an editor can compile what is on screen without saving it. The overlay is the CompileOptions::sources map compile_project already accepts; this module only reconciles its keys with the shape discovery produced.

Which paths are accepted. A path naming a source the build already read replaces that source’s text (the overlay wins over disk). A path that names a .bynk file inside the project root and no existing source is added: an unsaved new file. Anything else (a path outside the project, a non-.bynk file) is rejected rather than ignored: the caller would otherwise believe its buffer was compiled. A rejected overlay builds nothing.

Enums§

OverlayError
Why an overlay could not be applied.

Functions§

apply_overlay
Layer overlay over options’ sources for the project rooted at root (the directory the build was pointed at). See the module doc for which paths are accepted.
parse_overlay
Parse the --sources-stdin document.