Skip to content

Feature/test explorer namespace level#175

Open
sidec15 wants to merge 3 commits into
JaneySprings:mainfrom
sidec15:feature/test-explorer-namespace-level
Open

Feature/test explorer namespace level#175
sidec15 wants to merge 3 commits into
JaneySprings:mainfrom
sidec15:feature/test-explorer-namespace-level

Conversation

@sidec15
Copy link
Copy Markdown
Contributor

@sidec15 sidec15 commented Mar 3, 2026

Summary

Adds an optional namespace grouping level to the DotRush Test Explorer, aligning the tree structure with the C# Dev Kit Test Explorer experience when enabled. Grouping is off by default for backward compatibility. Users can enable it via a toolbar icon or settings. For projects with 1000+ tests (increasingly common with AI-assisted development), this grouping level significantly improves navigation and organization.

What Changed

Optional Grouping (New)

  • Setting: dotrush.testExplorer.groupByNamespace (boolean, default: false)
  • Toolbar icon: Toggle "Group by Namespace" button in the Testing view title bar ($(symbol-namespace))
  • Command: dotrush.testExplorer.toggleGroupByNamespace – flips the setting and refreshes the tree
  • Config change listener: Tree automatically refreshes when the setting is changed (via UI or settings.json)

Tree Structure (When Grouping Enabled)

  • ProjectNamespaceFixtureTest
  • When grouping is disabled (default): ProjectFixtureTest (flat, original behavior)

Backend & Logic

  • Added namespace to test fixture payload from Roslyn (TestExplorerHandler)
  • Updated VSCode test tree building to support both flat and grouped structures
  • Added Global fallback namespace for fixtures without a namespace
  • Ensured namespace nodes are reused per project+namespace (no duplicates)
  • Kept fixture/test IDs stable for discovery and execution flows
  • Updated fixture lookup and test request conversion logic to support both hierarchies
  • Fixed run filter generation so selecting a namespace includes all descendant fixtures/tests, including unresolved fixture nodes

Behavior Preserved

  • Test discovery still resolves fixtures/tests correctly
  • Run/debug flows continue to launch as before
  • Test status/result updates still map runtime results to the correct TestItems
  • Default experience unchanged: existing users see the flat structure unless they opt in

Notes

  • Changes are scoped to Test Explorer hierarchy and related ID/mapping logic only
  • No unrelated extension functionality was modified
  • The previous PR was closed because the author did not want grouping forced on all users; this implementation makes it optional and user-controlled

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