Skip to content

Enhance type name sanitization#48

Merged
HandyS11 merged 1 commit intodevelopfrom
fix/qualifyName
Feb 26, 2026
Merged

Enhance type name sanitization#48
HandyS11 merged 1 commit intodevelopfrom
fix/qualifyName

Conversation

@HandyS11
Copy link
Copy Markdown
Owner

This pull request improves the handling and rendering of fully qualified type names in class diagrams, particularly for cases involving colons (:) from global:: prefixes. It ensures that all global:: prefixes are removed and that colons are sanitized to underscores, preventing issues in Mermaid diagrams. The changes also add a test to verify this behavior.

Type name normalization improvements:

Rendering and sanitization enhancements:

Testing improvements:

Other minor changes:

Copilot AI review requested due to automatic review settings February 26, 2026 16:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request improves class diagram type-name normalization and Mermaid rendering robustness by eliminating global:: prefixes throughout fully qualified names and sanitizing : characters to avoid Mermaid parsing issues.

Changes:

  • Strip all occurrences of global:: from Roslyn fully qualified type names (including inside generic arguments).
  • Update Mermaid identifier sanitization to replace : with _ (and document the behavior).
  • Add a unit test to ensure :: does not appear in Mermaid output for types containing colons.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/ProjGraph.Lib.ClassDiagram/Infrastructure/TypeAnalyzer.cs Removes all global:: prefixes from fully qualified type names.
src/ProjGraph.Lib.ClassDiagram/Rendering/MermaidClassDiagramRenderer.cs Sanitizes : to _ to prevent Mermaid misinterpreting ::.
tests/ProjGraph.Tests.Unit.ClassDiagram/MermaidClassDiagramRendererTests.cs Adds coverage ensuring colons are sanitized in rendered Mermaid output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ProjGraph.Lib.ClassDiagram/Infrastructure/TypeAnalyzer.cs
@HandyS11 HandyS11 merged commit 1dc85f2 into develop Feb 26, 2026
7 checks passed
@HandyS11 HandyS11 deleted the fix/qualifyName branch February 26, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants