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

Go-to-def #31

Open
joneugster opened this issue Aug 8, 2024 · 8 comments
Open

Go-to-def #31

joneugster opened this issue Aug 8, 2024 · 8 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@joneugster
Copy link
Collaborator

Would be nice to have go-to-def open the correct page of the docs: https://leanprover-community.github.io/mathlib4_docs/

@joneugster joneugster added enhancement New feature or request bug Something isn't working labels Aug 8, 2024
@joneugster
Copy link
Collaborator Author

joneugster commented Aug 9, 2024

2b799f7 implements a go-to-def functionality.

  • It just opens the corresponding doc-gen page, but is missing #My.Lean.Declaration in the URL.
  • There is a console error associated with it: Ctrl+Hover over any definition to see it.
  • Have to click "Cancel" 4-5 times :(

@tautastic
Copy link
Contributor

tautastic commented Mar 7, 2025

@joneugster I still have the Have to click "Cancel" 4-5 times :( bug on macOS but not on Linux. Also the console error when doing Ctrl+Hover over any definition is also present in lean4monaco demo project, so this seems not related to the go-to-def functionality.

@joneugster
Copy link
Collaborator Author

joneugster commented Mar 7, 2025

It is related (not in the custom gotodef, but in monaco's gotodef), but youre right, ctrl-hiver should be fixed in lean4monaco. (sometimes the issues between lean4monaco and lean4web arent perfectly separated)

@tautastic
Copy link
Contributor

tautastic commented Mar 7, 2025

Also doing right-click then Go To References shows many References that seem valid but trying to view any of them that are not part of the current file throws a similar error. Could we allow lean4monaco access to the .lake/packages directory. Or maybe the first question is: do we want to? If not then maybe we should try to remove the cases where these kinds of errors occur. Also same issue for right-click then peek > peek definition and peek > peek type definition

@tautastic
Copy link
Contributor

@joneugster A quick temporary fix would be to open the source code instead of the docs, since we have the line number we can link directly to what was clicked on. See the code changes here: tautastic@5ce8886

@joneugster
Copy link
Collaborator Author

I think when I implemented this I decided that opening the correct doc page without line numer is nicer than opening the source. But that's probably just personal taste. Ofc getting the relevant info to open the right doc would be ideal

@tautastic
Copy link
Contributor

Is the desired behavior to improve the current solution or to get the "go-to" and "peek" stuff to work just like in vscode? I mean the mathlib files are on the server we could just open them in a new editor tab.

@joneugster
Copy link
Collaborator Author

That could be a nice feature, I suppose 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants