-
Notifications
You must be signed in to change notification settings - Fork 319
Add anchor preview in hover #1150
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
base: main
Are you sure you want to change the base?
Conversation
|
I think this sounds helpful. I can find time to review it, though I can't promise I'll be fast. I tried it out, and I have a good initial impression of it. I haven't tested it thoroughly or looked closely at the code yet though. I noticed it was disabled by default, any reason for that? It seems like a helpful feature, and I can't think of drawbacks of enabling it by default. People need to go out of their way to find any features that aren't enabled by default, which could mean it doesn't get used. |
|
As I didn't know if it was a common use case I conservatively set the default to false, but I agree with you that plenty of users might discover this hover by serendipity and enjoy it. For the resolveYamlMapMergeKeys function I guess we would need to limit the number of recursion to prevent performance issue in very large YAML (but I noticed there is a maxItemsComputed, so maybe it's enough to prevent it). Anyway it's good news it looks helpful to you. Thanks for the time you'll invest in testing/reviewing it. |
datho7561
left a comment
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 think this looks pretty good, but for performance reasons I think there should be some limit to prevent infinite recursion (the maxItemsComputed doesn't seem to stop it from computing when there's infinite recursion, so the hover never shows up and it seems to continue computing the result in the background).
Also, I really think this should be enabled by default.
556f7a1 to
235ca9f
Compare

What does this PR do?
It displays the preview of an anchor when hovering it.
What issues does this PR fix or reference?
This is a very rough proposal to check if you would be interested in merging this feature. If this is the case, I'll put more time in writing the test and improving the code based on your remarks.