improvement: delete old compilation units from pc
The idea is to delete compilation units from presentation compiler, that are no longer needed. The heuristic is as follows, we keep compilation units for the following paths:
- last 5 focused - probably we want this to be a configurable number
- modified since the last compilation
- outlined
I'm also hoping this means we can delete uncached pc.
last 5 focused
How will it work in editors which do not support custom Metals didFocus LSP extension? Would it track last 5 didOpen calls instead? :slightly_smiling_face:
How will it work in editors which do not support custom Metals didFocus LSP extension? Would it track last 5 didOpen calls instead? 🙂
"Focus" is called here on:
-
didOpen -
didChange(ifdidFocusis not supported) -
didFocus -
didClose(will focus on the previous opened)
I changed this to use last N files for which compilation unit was requested instead of last N focused. It's both easier (no need for additional pc method) and should be more reliable.