Defer part rejection exception in VSTypeScriptFormattingService to time of construction#58940
Conversation
|
@jasonmalinowski Based on the comments from @zkat , I plan to keep this pull request in its current form and marking it as auto-merge. |
jasonmalinowski
left a comment
There was a problem hiding this comment.
Let's switch to the AllowDefault pattern since we already have other PRs in flight expecting that.
…quire it in the constructor This change defers the MEF part creation exception in MEF 2 scenarios from the call to GetExports to the call (if any) to Lazy<>.Value. Rather than reject the part from the catalog entirely, this change allows the part to be included as long as it is not accessed.
| public VSTypeScriptFormattingService([Import(AllowDefault = true)] IVSTypeScriptFormattingServiceImplementation impl) | ||
| => _impl = impl ?? throw new ArgumentNullException(nameof(impl)); |
There was a problem hiding this comment.
This probably deserves a comment here explaining why we are doing AllowDefault but then still blocking it. Feel free to add as a follow-up since CI is green.
|
https://sharplab.io seems to fail even after this merge, see.: ashmind/SharpLab#922 |
|
@bernd5 That issue was filed before this change was merged. Do you have information about the failure which still occurs? |
|
@sharwell: Oh, I have mixed up a commit. |
Fixes #58817 (comment)