What
Requesting code actions on a type declaration can surface Roslyn's own Generate overrides... provider alongside the sidecar's headless replacement (HeadlessOverrideCodeAction). Resolving the Roslyn one fails:
Service of type 'Microsoft.CodeAnalysis.PickMembers.IPickMembersService' is required
to accomplish the task but is not available from 'MSBuildWorkspace' workspace.
IPickMembersService is a MEF-composed IDE service that does not exist in a headless MSBuildWorkspace, which is precisely why HeadlessOverrideCodeAction exists. Both actions carry the identical title Generate overrides..., so which one a client gets depends on ordering — the user sees an action that sometimes works and sometimes errors.
Reproduce
Observed against src/editors/vscode/test-fixtures-style sources while writing HeadlessOverrideGenerationTests. Put the caret on the identifier of an abstract class that inherits only object's virtuals (so the headless provider contributes nothing), request code actions, then resolve the Generate overrides... entry.
Expected
MEF-dependent providers that cannot run headlessly should be filtered out of the code-action list, so the only Generate overrides... offered is the one that actually works. A duplicate title should never be ambiguous.
Notes
Not a regression from the current PR — the headless replacement and the leak arrived together. Filed separately rather than widening that PR's scope.
What
Requesting code actions on a type declaration can surface Roslyn's own
Generate overrides...provider alongside the sidecar's headless replacement (HeadlessOverrideCodeAction). Resolving the Roslyn one fails:IPickMembersServiceis a MEF-composed IDE service that does not exist in a headlessMSBuildWorkspace, which is precisely whyHeadlessOverrideCodeActionexists. Both actions carry the identical titleGenerate overrides..., so which one a client gets depends on ordering — the user sees an action that sometimes works and sometimes errors.Reproduce
Observed against
src/editors/vscode/test-fixtures-style sources while writingHeadlessOverrideGenerationTests. Put the caret on the identifier of anabstractclass that inherits onlyobject's virtuals (so the headless provider contributes nothing), request code actions, then resolve theGenerate overrides...entry.Expected
MEF-dependent providers that cannot run headlessly should be filtered out of the code-action list, so the only
Generate overrides...offered is the one that actually works. A duplicate title should never be ambiguous.Notes
Not a regression from the current PR — the headless replacement and the leak arrived together. Filed separately rather than widening that PR's scope.