release

private fun release(file: KtFile)

Gives file's module back to the analysis caches. Only that module goes — a module-level removal evicts the module's own session and any dangling session contextual to it, and leaves library sessions, and with them the classpath index, alone.

Published on the analysis message bus, which reaches every cache keyed on the module. Handing the event straight to the FIR session cache instead reaches only that one, and whatever else is holding the module goes on holding it — and with it the file's whole PSI tree.