-
Notifications
You must be signed in to change notification settings - Fork 297
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
feat(command): Add #where
command, dumping environment info
#489
feat(command): Add #where
command, dumping environment info
#489
Conversation
51f95e4
to
3b7e065
Compare
I gave this a little spin, and I think it is going to be really useful. But I couldn't fully understand the results. Here is what I did.
The namespace is as expected, but there is a lot of duplication in the variables. Also, I have no idea what the |
Hi @jcommelin sorry, I didn't think of this. The problems + garbage in there is highly fixable. I'll try to do it today. |
@jcommelin Should be all fixed now. You should now see exactly what you expected (and was intended---plus your nice "namespace" suggestion). |
698ddab
to
0fb4126
Compare
Could we make this exported by |
Done |
Here's a typical piece of output that I got namespace category_theory.limits
variables {K : Type ?} {C : Type ?} {J : Type ?} [𝒞 : category C] [𝒦 : small_category K] [_inst_1 : small_category J]
include C 𝒞 K 𝒦
end category_theory.limits I think this is really helpful. However, as you can see, it didn't figure out the universe parameters. Is that within reach? |
71234fc
to
9e6001c
Compare
@robertylewis No, everything should be in there now. Just so that it is recorded here, I fixed Johan's problem and added the |
Hmm, I think this will significantly hamper the convenience of I also predict that if this command is not imported by default, then you will start receiving PRs with |
I agree that people will accidentally |
I completely agree with Reid. I understand Mario's objections, but they are in some sense ideological, I think. From a practical point of view, |
If you were implementing |
It'd be cool to be able to tell VSCode to import some files by default which change how some pieces of the environment work |
Wouldn't those new imports trigger massive recompilation? |
Sure |
The command tells you your current namespace (wherever you write it), the current `include`s, and the current `variables` which have been used at least once.
All fixed up now. :) |
The command tells you your current namespace (wherever you write it), the current `include`s, and the current `variables` which have been used at least once.
Add the
#where
command.The command tells you your current namespace (wherever you write it),
the current
include
s, and the currentvariables
(variables must have beenused at least once).
Some spurious
name
manipulation andlean.parser
code-generation facilities have been added totactic/basic.lean
for this purpose. (Maybe atactic/parser.lean
file will be eventually be warranted?)We also add a few useful parser library functions (at the bottom of
tactic.where
): e.g. If you're in thelean.parser
monad you can just callget_namespace
to retrieve thename
of the current namespace. If you're defining a tactic, you can add(p : interactive.parse lean.parser.get_namespace)
to its parameters to parse the namep
of the current namespace.TO CONTRIBUTORS:
Make sure you have:
For reviewers: code review check list