Application, workspace and document lifecycle
Application
mainparses arguments and creates the window.Ide::newloads settings, profiles, trust and extensions from the user config directory. It starts no processes and makes no network requests; invalid configuration becomes a notice and safe defaults.- If a path was given, the folder is opened (only its top level is read).
- Each frame the UI drains core events (
Ide::poll), applies input, and paints. Language-service timers schedule a repaint at their deadline, so an idle app draws nothing. - On quit with unsaved changes the app asks first. On exit, language servers get
shutdown/exitand are killed after 2 s if they do not stop.
Workspace
A workspace is identified by its canonical root path. Opening one:
- reads only the root directory; subdirectories are read when expanded and never re-read implicitly (use Refresh Explorer);
- hides
.git,.hg,.svn,node_modules,__pycache__,.venvplus profile additions such astarget; - lists directory symlinks but does not follow one that resolves to its own ancestor;
- records unreadable directories as errors on their node;
- sets the trust state from the user's trust store;
- refuses to replace the current workspace while documents have unsaved changes.
Documents
A clean document that changes on disk simply reloads and stays clean.
- Opening reads the whole file once, rejects binary (NUL byte in the first 8 KiB), non-UTF-8 and files over 64 MiB with a clear message, and opens an already-open file only once.
- Editing applies a transaction to the rope, then updates the syntax tree incrementally, shifts diagnostics, and forwards the change to the language server (incremental sync when supported).
- Saving checks the on-disk fingerprint (size and modification time) first. If the file changed since it was loaded or saved, the save is refused until the user chooses to overwrite or reload. Writes go to a temporary file in the same directory, are flushed, then renamed over the target. Symlinks and permissions are preserved.
- External changes are checked when the window regains focus. Clean documents reload; dirty ones show a banner and are never changed silently.
- Closing a dirty document asks Save / Discard / Cancel. Closing unregisters it from its language service, which may then become idle.
Fingerprint limits
Change detection compares size and modification time. A same-size write within the filesystem's timestamp resolution can go unnoticed. There is no file watcher yet; see the backlog.