Skip to content
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

Only show element hover information when hovering over an element in a .razor file #11336

Merged
merged 1 commit into from
Jan 1, 2025

Conversation

davidwengier
Copy link
Contributor

Fixes #11335

Event callbacks on components use the tag helper infrastructure internally in the compiler, but it makes sense to me to have different rules applied to them when it comes to showing hover info. Leaving the existing code as is for .cshtml files is entirely deliberate.

Before:
Before

After:
image

@davidwengier davidwengier requested a review from a team as a code owner December 31, 2024 03:21
// Filter out attribute descriptors since we're creating an element hover
var keepAttributeInfo = FileKinds.GetFileKindFromFilePath(documentFilePath) == FileKinds.Legacy;
var descriptionInfos = descriptors
.Where(d => keepAttributeInfo || !d.IsAttributeDescriptor())
Copy link
Contributor

@alexgav alexgav Dec 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems a little wrong to execute the where clause at all when keepAttributeInfo is true, but probably not worth complicating the code since n is going to be low and perf savings small.

@davidwengier davidwengier merged commit 5e8c1d6 into dotnet:main Jan 1, 2025
12 checks passed
@davidwengier davidwengier deleted the SimplifyComponentHover branch January 1, 2025 22:41
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hovering over a component shows every bound event handler
2 participants