razor icon indicating copy to clipboard operation
razor copied to clipboard

"Fix" hovers interfaces classification

Open DoctorKrolic opened this issue 3 years ago • 1 comments

Fixes: https://github.com/dotnet/razor-tooling/issues/6887

One of the dirtiest workarounds I've done in a while. The propper fix would be to reuse roslyn as I mentioned earlier. Or if it is considered impossible/not worth it the razor compiler should have a way to access underlying C# Compilation, so tooling code can use it to get an INamedTypeSymbol from symbol's name to correctly determine its kind. Because this workaround is only classifying interfaces. If the summary contains, lets say, a struct, which is displayed differently than a class, the classification would make it a default type and it is not correct

Also fixed namespace classification and made tests use raw strings (and github is kinda broken because of it)

DoctorKrolic avatar Oct 18 '22 20:10 DoctorKrolic

I don't think we want to take this. The problem isn't big enough in my mind to warrant this workaround, and there are plenty of other issues with hover text anyway.

davidwengier avatar Oct 19 '22 01:10 davidwengier

I don't think, that the team has plans to work on hovers in the near future) This workaround is 100% temporary until such moment comes. Are you sure, that you don't accept this? Also please consider that all tag helpers' summaries are formed like ITagHelper implementation for XXX tag, so this can fix quite a few visuals when working with razor pages projects.

DoctorKrolic avatar Oct 20 '22 15:10 DoctorKrolic

I tend to agree with @davidwengier. I don't think we should take hacks like this one, even if they're temporary.

DustinCampbell avatar Oct 20 '22 20:10 DustinCampbell

Ok, closing PR

DoctorKrolic avatar Oct 21 '22 08:10 DoctorKrolic