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

Copy module name to clipboard #565

Open
alreadydone opened this issue Jan 8, 2025 · 1 comment
Open

Copy module name to clipboard #565

alreadydone opened this issue Jan 8, 2025 · 1 comment

Comments

@alreadydone
Copy link

alreadydone commented Jan 8, 2025

Given a file mathlib4/aaa/bbb/ccc.lean open in VSCode, I'd like to one-click copy the string aaa.bbb.ccc to the clipboard. This is useful if you want to import the current file in another file, or if you want to run lake build aaa.bbb.ccc in the terminal (sometimes if you build the file by restarting it, the progress may not be displayed.) This feature could be implemented as a command (possibly called Lean 4: copy module name) which one can select after hitting Ctrl+Shift+P.

Zulip

@mhuisi
Copy link
Collaborator

mhuisi commented Jan 9, 2025

Note that in general, converting a file path to a module name requires the Lean search path (also as mentioned in the thread you linked) because Lake allows configuring the library root. I don't know of any way to extract that information from Lake (cc: @tydeu).

We could still provide a heuristic that works for libraries with the default root configuration, though.

@mhuisi mhuisi transferred this issue from leanprover/vscode-lean Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants