redhat-developer / yaml-language-server

Language Server for YAML Files
MIT License
1.1k stars 264 forks source link

fix: show all enums on hover #942

Closed twelvelabs closed 11 months ago

twelvelabs commented 1 year ago

What does this PR do?

This PR updates the hover service to display all possible enum values, rather than just the currently selected one. Additionally, it will display the enums regardless of whether the schema contains explicit descriptions (though it will continue to display the descriptions if present - see included test case).

Screen Shot 2023-12-03 at 3 56 05 PM



Also:

What issues does this PR fix or reference?

Fixes #941

Is it tested? How?

twelvelabs commented 11 months ago

cc @gorkem and @msivasubramaniaan for visibility.

coveralls commented 11 months ago

Coverage Status

coverage: 84.071% (+0.3%) from 83.813% when pulling f73cc82328f271e71362e6d63e838412be2dc4f5 on twelvelabs:enums-on-hover into ed03cbf71ade29ea62b4bcac0d8952195fd6969d on redhat-developer:main.

signaledge commented 5 months ago

@msivasubramaniaan @twelvelabs This feature really broke our workflow, we use arrays where items are defined with a huge list of enums (and markdownEnumDescriptions), and now hover will not work as it tries to render the full list of enum instead of trying to show the markdownEnumDescription for the enum entry being hovered on first. I also think this feature has limited purpose as the list is available with autocompletion. I suggest to put this change behind a setting which can be disabled.