Open cloneable opened 11 months ago
I have implemented such AST walker for running jrsonnet with imports in browser, but it is not good, and needs to be updated. https://github.com/CertainLach/jrsonnet/blob/master/crates/jrsonnet-evaluator/src/async_import.rs
Upstream issue: https://github.com/google/jsonnet/issues/770
Hi! Besides #116 I'd like to offer another feature: showing the imports graphs of defined imports and effective imports. For my demo tool I already managed to simply wrap the
ImportResolver
to track what's imported during evaluation. Good enough for the tool.I also would like to show the entire imports graph of all potential imports. For that I think I have to walk the AST. My first idea was to re-use my
ImportResolver
implementation to parse the contents fromload_file_contents
and check for defined imports, but I can't distinguish betweenimport
,importstr
andimportbin
at this point properly and things would get too hacky even for demo code.Do you know of a good way to get the exhaustive imports graph? (Btw, I believe this too would be a useful feature to have in jrsonnet-cli.)