ols
ols copied to clipboard
Issues with implementing when statements in the current way we handle indexing.
Right now the indexer is quite simple and just stores the ast nodes for all the global constants and variables. This means when something changes in other files, the indexer doesn't care since everything gets resolved lazily.
This has worked fine until trying to implement the when statements. The issue is the when statements may require global variables or config from other files, and since we don't resolve the variables when indexing, it's impossible to do it the current way.
There are two solutions in my mind:
- Change the way we index and now we do more resolving of types in the indexer, but that means we need some dependency graph to rebuild the indexer when files change.
- Keep the same system, but store some
whenevaluation index for each global expr that is underwhenstatements, that then can be resolved lazily and cached.