Skip to content

Fix blank designer surface and make load failures diagnosable - #1

Merged
robertmclaws merged 1 commit into
mainfrom
fix/designer-safety-diagnostics
Aug 9, 2026
Merged

Fix blank designer surface and make load failures diagnosable#1
robertmclaws merged 1 commit into
mainfrom
fix/designer-safety-diagnostics

Conversation

@robertmclaws

Copy link
Copy Markdown
Collaborator

Fix

  • Designer section with <Diagrams> before <Connection>/<Options> failed XSD validation → artifact designer-unsafe → diagram never created → blank surface, nothing in the Error List
  • TDesigner changed from xs:sequence to xs:choice; the parser dispatches on element name, not position, so the order never meant anything

Diagnostics

  • Structural pre-conditions reported individually instead of collapsed into one boolean
  • Schema errors keep message + (line N, position N) instead of just a count
  • Error List fallback when the doc can't be matched to a project — was silently dropped (also broken upstream in dotnet/ef6tools)
  • Removed bare catch { } in IsXmlValid
  • Load/validation traces go to IVsActivityLog, not just Debug.WriteLine

UI

  • Floating zoom commands disabled until a designer instance loads — fixes the Show Grid assertion. LoadView runs before OnDocumentLoaded, so the view subscribes to a new ModelDiagramLoaded event instead of polling
  • Removed dead HasLoadException bindings (WPF binding error on every Model Browser open)

Removed

  • WCF Data Services handling, 5 files
  • EDMX v1/v2 schemas — embedded and copied to output, never loaded

Tests

  • 13 new: Designer child ordering, schema error retention. No mocks
  • Verified they fail against the old xs:sequence
  • SvgShapeRendererTests[DoNotParallelize]; raced DSL Store statics, failed ~60% of runs. 6 clean runs since
  • Full suite: 1119 passed, 0 failed

Notes

  • Also carries marketplace metadata already in the tree (README, publishManifest.json, vsixmanifest)
  • Merging to main auto-publishes to VS Marketplace and cuts a release

🤖 Generated with Claude Code

A model whose Designer section listed <Diagrams> before <Connection> and
<Options> failed EDMX schema validation. That made the artifact designer-unsafe,
which silently skipped diagram creation, so the designer opened blank with
nothing in the Error List to act on.

Root cause and reporting:
- Relax TDesigner in Edmx_3.xsd from xs:sequence to xs:choice. The parser
  dispatches on element name rather than position, so the order carried no
  meaning; only the schema cared.
- Check each structural pre-condition independently and report each failure,
  instead of collapsing seven checks into one silent boolean.
- Retain schema validation messages and source locations rather than only a
  count, so an invalid document names the element and line.
- Report validation errors when the document cannot be matched to a project
  instead of discarding them, and stop swallowing exceptions during validation.
  Both defects are present upstream in dotnet/ef6tools.
- Send load and validation diagnostics to IVsActivityLog as well as the
  debugger, so failures leave a trace in Release builds.

UI:
- Disable the floating zoom commands until a designer instance is loaded. The
  doc view's LoadView runs before the doc data's OnDocumentLoaded, so the view
  subscribes to a notification rather than polling. Fixes an assertion when
  toggling Show Grid over a blank surface.
- Remove the dead HasLoadException bindings, which logged a WPF binding error
  on every Model Browser open and could never resolve.

Removals, neither reachable for EF 6.5:
- WCF Data Services detection and handling.
- EDMX v1 and v2 schemas, which were embedded and copied but never loaded.

Tests:
- Cover Designer child ordering and schema error retention. Verified they fail
  against the previous schema.
- Serialize SvgShapeRendererTests, which raced DSL Store static initialization
  under method-level parallelism and failed roughly 60% of runs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@robertmclaws
robertmclaws merged commit acad8c7 into main Aug 9, 2026
4 checks passed
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.

1 participant