Implement IEquatable<ISuggestedActions> for all Roslyn ISuggestedActions. The...
Implement IEquatable<ISuggestedActions> for all Roslyn ISuggestedActions. The implementation treats any SuggestedActions that have the same provider as well as CodeActions with equal non-null 'Id's as equivalent. Also override 'Id 'for CodeActions of the following code fixes to reduce the occurence of duplicate fixes in the lightbulb menu - Add Imports, Generate Type and Generate Property / Field. Note: Addressing the above three code fixes takes care of the most common cases where users currently see duplicate fixes in the light bulb menu. We can apply similar de-duping for several other code fixes but we will address them separately later. Also fixing a couple of other problems discovered while testing this fix - 1. The 'implement interface' code fix provider was using same Id for the simple 'implement interface' code action as well as the 'implement dispose pattern' code action causing the latter to be filtered out. This was also causing problems during 'fix all occurrences'. Fixed this by including the type name of the code action in its Id. 2. When invoking SuggestedActionSet constructor, we were passing in linq queries that would construct new SuggestedActions in a couple of places. The platform implementation for SuggestedActionSet would store this query directly in a field and end up returning a new set of SuggestedActions each time the field was accssed. This ended up causing problems when the platform code tried to de-dupe the fixes (because different fixes would be returned each time). I have changed Roslyn-side code to pass in ImmutableArrays instead - but platform (Oleg) is also fixing the platfrom code to be more robust for this issue. (changeset 1396084)
Showing
想要评论请 注册 或 登录