-
Notifications
You must be signed in to change notification settings - Fork 196
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
tooltip fix for hover and code completion on VS code #9862
Conversation
Make the tooltip show the full tagHelperTypeName instead of the reduced name in LSP factory. This method is used in both hover service and code completion service.
...r/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/DefaultLSPTagHelperTooltipFactory.cs
Outdated
Show resolved
Hide resolved
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'm interested to know, what makes ReduceTypeName(...)
return a different value on VS Code vs. VS? It feels like the answer to that question would lead to the best fix. Since there are existing unit tests that verify the current behavior, I suspect that changing the user experience isn't the best fix.
-DefaultLSPTagHelperTooltopFactoryTest.cs: changed three unit tests so we are testing for showing the full name space - HoverInfoServiceTest.cs: changed the test to match the scenario of child hover show the namespce of parent.
Thank you for your comment @DustinCampbell. Thanks to @davidwengier who pointed out in issue #9638, there are "two different code paths for generating hovers". We can re-produce the reduced TypeName behavior in Visual Studio by "forcing the I think the difference exists because VS Code takes markdown text as an input to display hover information to the user whereas in Visual Studio it accepts I think the end goal is for VS Code users to have the same amount of information on the UI side as the Visual Studio users. An immediate future step is to investigate how we can also "classify" the text in hover description for VS code. |
- implemented simple logic to make the reducedTypeName bold while still keeping the namespace but leaving it intact - changed unit tests in DefaultLSPTagHelperTooltipFactoryTest and HomeInfoServiceTest to reflect such desired behavior
...r/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/DefaultLSPTagHelperTooltipFactory.cs
Outdated
Show resolved
Hide resolved
I'm definitely on board with that. I just want to make sure that this PR only changes the VS Code user experience and doesn't actually change VS experience. Is that the case? |
...r/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/DefaultLSPTagHelperTooltipFactory.cs
Outdated
Show resolved
Hide resolved
...r/src/Microsoft.AspNetCore.Razor.LanguageServer/Tooltip/DefaultLSPTagHelperTooltipFactory.cs
Outdated
Show resolved
Hide resolved
- using the range operator instead for getting the namespace of the TagHelper - other fixes: reducing extra white line, fixing comment
As far as I understand that is correct. The tooltip for Visual Studio is being handled in |
deleted an extra comment
Make the tooltip show the full tagHelperTypeName instead of the reduced name in LSP factory. This method is used in both hover service and code completion service.
Fixes #9638
Summary of the changes
Fixes:
Testing:
Before
After