ols icon indicating copy to clipboard operation
ols copied to clipboard

Issues with implementing when statements in the current way we handle indexing.

Open DanielGavin opened this issue 4 months ago • 2 comments

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 when evaluation index for each global expr that is under when statements, that then can be resolved lazily and cached.

DanielGavin avatar Aug 04 '25 12:08 DanielGavin