Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate imports graphs #128

Open
cloneable opened this issue Aug 13, 2023 · 2 comments
Open

Generate imports graphs #128

cloneable opened this issue Aug 13, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@cloneable
Copy link

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 from load_file_contents and check for defined imports, but I can't distinguish between import, importstr and importbin 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.)

@CertainLach
Copy link
Owner

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

@CertainLach
Copy link
Owner

Upstream issue: google/jsonnet#770

@CertainLach CertainLach added the enhancement New feature or request label Aug 13, 2023
@CertainLach CertainLach added this to the Not planned (yet?) milestone Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants