Fix VSMEF008 to emit fully-qualified type names in diagnostic messages#686
Merged
Fix VSMEF008 to emit fully-qualified type names in diagnostic messages#686
Conversation
…ssage Co-authored-by: AArnott <3548+AArnott@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Address feedback from PR #682 discussion
Fix VSMEF008 to emit fully-qualified type names in diagnostic messages
Mar 2, 2026
AArnott
approved these changes
Mar 2, 2026
There was a problem hiding this comment.
Pull request overview
Improves the usefulness of the VSMEF008 analyzer diagnostic by emitting namespace-qualified type names in the diagnostic message, reducing ambiguity when short type names collide across namespaces.
Changes:
- Updated VSMEF008 analyzer to format both contract/member types using the existing
FullyQualifiedTypeNameFormat. - Added a regression test asserting VSMEF008 diagnostic arguments contain namespace-qualified type names.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Microsoft.VisualStudio.Composition.Analyzers/VSMEF008ImportContractTypeMismatchAnalyzer.cs | Switches diagnostic type formatting to a namespace-qualified SymbolDisplayFormat. |
| test/Microsoft.VisualStudio.Composition.Analyzers.Tests/VSMEF008ImportContractTypeMismatchAnalyzerTests.cs | Adds a test validating the diagnostic message arguments use fully qualified type names. |
Newrad0603
approved these changes
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VSMEF008 diagnostic messages were showing only short type names, making it hard to identify which types were involved when names collide across namespaces.
Before:
After:
Changes
VSMEF008ImportContractTypeMismatchAnalyzer.cs: ReplacedSymbolDisplayFormat.CSharpShortErrorMessageFormatwith the existingFullyQualifiedTypeNameFormat(which usesNameAndContainingTypesAndNamespaces) when formatting both type arguments in the diagnostic message.VSMEF008ImportContractTypeMismatchAnalyzerTests.cs: AddedDiagnosticMessage_UsesFullyQualifiedTypeNamestest that asserts diagnostic arguments contain namespace-qualified names.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
h8evsblobprodwus2120.vsblob.vsassets.io/opt/hostedtoolcache/dotnet/dotnet /opt/hostedtoolcache/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/vs-mef/vs-mef/bin/Tests/Microsoft.VisualStudio.Composition.Analyzers.Tests/Release/net8.0/Microsoft.VisualStudio.Composition.Analyzers.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/vs-mef/vs-mef/bin/Tests/Microsoft.VisualStudio.Composition.Analyzers.Tests/Release/net8.0/Microsoft.VisualStudio.Composition.Analyzers.Tests.deps.json /home/REDACTED/work/vs-mef/vs-mef/bin/Tests/Microsoft.VisualStudio.Composition.Analyzers.Tests/Release/net8.0/testhost.dll --port 45841 --endpoint 127.0.0.1:045841 --role client --parentprocessid 5311 --telemetryoptedin false(dns block)xofvsblobprodwus2114.vsblob.vsassets.io/opt/hostedtoolcache/dotnet/dotnet dotnet build src/Microsoft.VisualStudio.Composition.Analyzers/Microsoft.VisualStudio.Composition.Analyzers.csproj -c Release --no-restore(dns block)/opt/hostedtoolcache/dotnet/dotnet dotnet build test/Microsoft.VisualStudio.Composition.Analyzers.Tests/Microsoft.VisualStudio.Composition.Analyzers.Tests.csproj -c Release(dns block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.