typescript-program.ts view source
AnalysisLanguageService Persistent language-service handle that drives a ts.Program incrementally.
Owns the LS, document registry, and a Map<path, {content, version}> of
"owned" files (real source files + virtuals pushed via setFile). Files
not in the owned map are read from disk on demand by the LS host.
Each setFile(path, content) bumps the version when content differs from
cache, so the next getProgram() reparses only the changed file. Calling
getProgram() with no version bumps returns the same ts.Program as the
previous call (reference-stable when nothing changed).
see also
``createAnalysisSession`` in session.ts for the high-level API that wraps this with content cache + svelte virtual cache + analysis pipeline.