Zulip Chat Archive
Stream: general
Topic: determine imports of current file
Scott Morrison (Feb 22 2020 at 17:49):
Is there an API to determine the imports of the current file? It seems you could almost, but not quite, determine this information from judicious use of environment.decl_olean
.
Scott Morrison (Feb 22 2020 at 17:49):
It would be lovely to have a linter that reduced unnecessary imports.
Patrick Massot (Feb 22 2020 at 17:49):
Last time I asked this wasn't possible.
Patrick Massot (Feb 22 2020 at 17:49):
But that was Lean3.4.2 time.
Scott Morrison (Feb 22 2020 at 17:50):
I think there might be a crazy hack, that would rely on adding a few extra lines at the end of every file (i.e. so might be usable in a script)
Scott Morrison (Feb 22 2020 at 17:50):
But if we can expose it directly, even better.
Johan Commelin (Feb 22 2020 at 18:04):
Simon had tools for this with olean-rs
, right?
Johan Commelin (Feb 22 2020 at 18:04):
At some point this was even part of CI, I think
Gabriel Ebner (Feb 22 2020 at 18:17):
We already have functions that allow you to import modules into an environment, but apparently none that tells you the dependencies.
Last updated: Dec 20 2023 at 11:08 UTC