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
Highlight all occurrences when mouse hovers a symbol in generated HTML #4535
Conversation
Rebased on master |
@@ -0,0 +1,28 @@ | |||
var highlight = function (on) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add copyright notice from Haddock project. Check that the file indeed comes from there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I modified it a little, not sure how does that affect the copyright though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the copyright line and a link to the license
Thanks for the pull request. I don't know how useful this could be for me personally, but if Haddock has it, then we should have it too I also see you changed a lot of the spacing in the |
More highlighting is not necessarily better. Could you explain the rationale for this feature? How should it be used? I can imagine that it might be nice to see every instance of a given bound variable. However, in the linked example, when you hover over the pattern variable I don't see the point of seeing every instance of (say) I also wondered about the performance of this feature, and apparently "this feature may cause browser performance problem". |
This can be helpful for understanding complicated scoping, such as
Then it's a bug of the href generator.
We can also say "this is how you discover new features".
Again in the document, this feature is disabled by default, so I don't think we're bringing burden. |
This is because I added a really long option and I don't know how to shorten it. So I need to add a line which doesn't align the others. I feel like there will be someone doing this anyway, so I just did it by the way. Now all of these options are aligned in a very safe position that is less likely to be changed in the future, so I'm gonna keep it for now. I am not strong on this though, feel free to "ask me" to remove them. I'll revert the changes. |
CI passes |
Since all comments are addressed, I'm gonna take this in. I'm still open to further changes, just reply to this thread. |
Ideally, this feature would not switched by the generator of a html page, but the viewer. However, I suppose, this would require a more sophisticated Agda viewer implemented in JS, with an options menu, and cookies to store the choice... |
I disagree with your claim.
As I wrote above I don't see the point of this feature. Perhaps there is no runtime cost to users who do not use it, but there could still be a maintenance cost for developers.
Can you give a specific example of how you intend to use the feature? |
I was talking about the review comments, sorry for the ambiguity.
I can take care of future changes related to this feature. I'd like to call this feature "show usages", because it shows usages (in the current web page) for definitions. |
It also helps distinguishing similar names. If unfortunately your computer cannot display some pure-unicode symbols and you don't want to click on each "cannot be displayed" symbols to see their definitions, this feature may help you. |
See https://twitter.com/i/status/1241631880388194304
This idea is stolen from Haddock.
Tests are on the way.