-
Notifications
You must be signed in to change notification settings - Fork 767
Open
Labels
P-mediumWe may work on this issue if we find the timeWe may work on this issue if we find the timeenhancementNew feature or requestNew feature or requestnice to haveCool feature that would be really nice to haveCool feature that would be really nice to haveserverAffects the Lean server codeAffects the Lean server code
Description
@Kha suggested exploring how go to definition could look like for a type shown in a hover. It seems the front end part of this feature would work quite well, with a few drawbacks.
- Markdown code blocks (
```lean) do not support links, so we would need to switch to language independent HTML code blocks (<code>) for the type in the hover (not for the documentation with possible lean code examples). - This would require enabling HTML in hovers in the client (with a limited set of allowed tags for security reasons), which is currently only support per
MarkdownString, i.e. needs to be set for each incoming hover text. This is supposed to change with LSP 3.17 (see this issue). - Although this works in VSCode and other Markdown renderers, I'm not sure if links (of the form
[]()) are always rendered as such inside HTML code blocks, which might be relevant for other editors or if a renderer is changed. - HTML code blocks do not fill the hover completely and have a slightly darker background, which looks a bit weird.
The benefit, of course, is the possibility of jumping to the definition of a type appearing in the type of an expression in the code, which I find quite useful. What do you all think of it?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P-mediumWe may work on this issue if we find the timeWe may work on this issue if we find the timeenhancementNew feature or requestNew feature or requestnice to haveCool feature that would be really nice to haveCool feature that would be really nice to haveserverAffects the Lean server codeAffects the Lean server code
