Skip to content

Fix duplicate project roots in multi-root workspaces - #1061

Draft
wenyt (wenytang-ms) wants to merge 10 commits into
mainfrom
fix/1060-multi-root-progressive-projects
Draft

Fix duplicate project roots in multi-root workspaces#1061
wenyt (wenytang-ms) wants to merge 10 commits into
mainfrom
fix/1060-multi-root-progressive-projects

Conversation

@wenytang-ms

@wenytang-ms wenyt (wenytang-ms) commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • refresh the project tree when project-import events arrive after the language server is fully ready
  • keep progressive project insertion limited to single-folder workspaces so multi-root trees cannot mix WorkspaceNode and ProjectNode roots
  • normalize project file paths before deduplication, including Windows URI variants and trailing separators
  • add single-root URI deduplication and mixed multi-root regression coverage

Multi-root workspaces now wait for the final server-ready refresh instead of showing incorrectly grouped progressive placeholders. Single-root progressive loading remains unchanged.

Testing

  • npm run compile
  • npm run tslint
  • Maven Project View Tests: 14 passing
  • Multiple Project View Tests: 1 passing

Fixes #1060
Related to redhat-developer/vscode-java#4478

UI verification

Before (#4478): the Java project genAicmaa is incorrectly nested under the non-Java SagApkGen workspace folder.

Java project assigned to the wrong workspace folder

After: workspace-folder ownership is preserved: my-app is under maven, while non-java remains an empty workspace root.

Java project assigned to its Maven workspace folder

The visibility of an empty non-Java workspace root is separate behavior tracked by #758.

wenyt (wenytang-ms) and others added 3 commits August 19, 2026 10:47
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
wenyt (wenytang-ms) and others added 3 commits August 19, 2026 13:13
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes duplicate or misplaced Java project roots in multi-root workspaces, addressing #1060 and related issue #4478.

Changes:

  • Restricts progressive insertion to single-root workspaces and normalizes URI deduplication.
  • Refreshes normally for post-readiness import events.
  • Adds integration and AutoTest regression coverage.

Reviewed changes

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

Show a summary per file
File Description
.github/workflows/e2eUI.yml Uses Node.js 22 for AutoTest jobs.
src/languageServerApi/languageServerApiManager.ts Refreshes after ready-state imports.
src/views/dependencyDataProvider.ts Guards progressive insertion and normalizes URIs.
test/e2e-plans/java-dep-project-explorer.yaml Adds mixed multi-root UI coverage.
test/index.ts Runs the new multi-root suite.
test/maven-suite/projectView.test.ts Tests equivalent-URI deduplication.
test/multiple-suite/index.ts Configures the multi-root test runner.
test/multiple-suite/projectView.test.ts Tests multi-root node structure.
test/multiple/multiple-project.code-workspace Adds a non-Java workspace root.
test/non-java/package.json Provides the non-Java fixture.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/views/dependencyDataProvider.ts Outdated
wenyt (wenytang-ms) and others added 4 commits August 19, 2026 13:51
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 15fc06b3-db1a-46df-9a34-7e8cd1128ba4
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 15fc06b3-db1a-46df-9a34-7e8cd1128ba4
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Java Projects tree duplicates or misplaces projects in multi-root workspaces

2 participants