AddOpenCodeFixProvider
does not take generics into account
#17150
Labels
Milestone
AddOpenCodeFixProvider
does not take generics into account
#17150
Uh oh!
There was an error while loading. Please reload this page.
If your type name is clearly a generic name, the suggested
open
s from theAddOpenCodeFixProvider
do not include the generic ones.Repro steps
Type the following code in a file that does not have the collections open:
Expected behavior
The suggestions for the type should either:
a. include only any generic types, as the current type if clearly generic
b. include both generic types and non-generic ones
Actual behavior
Only the non-generic ones are shown in the list of suggestions.
Known workarounds
Fix it by hand instead.
Related information
I feel like the reported range for the FS0039 should include the generic part as well (as seen in the screenshot, it isn't, and therefore the code fix provider cannot trivially get enough information). I remember, though, that in a not so far away past, generic types were included in the dropdown, so this may have been a conscious removal. Yet I wonder if we could get it back?
Seen in latest RTM of VS, and seen in VS 17.10.0 Preview 7.0 on Windows 11.
The text was updated successfully, but these errors were encountered: