Skip to content

feat: add multi-root workspace support #121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
May 13, 2025
Merged

feat: add multi-root workspace support #121

merged 20 commits into from
May 13, 2025

Conversation

ashish10alex
Copy link
Owner

@ashish10alex ashish10alex commented Mar 9, 2025

Solves: #110

TODO:

  • build basic multi-root workspace experience
  • When both workspaces have a file with same filename it does not know that it is in the wrong workspace . Have added a user command which can be used to select the correct workspace
  • test in windows
  • test user experience
  • ensure no regression

@ashish10alex ashish10alex marked this pull request as draft March 9, 2025 21:43
@ashish10alex ashish10alex added this to the v0.11.0 milestone Mar 24, 2025
@ashish10alex ashish10alex modified the milestone: v0.11.0 Mar 25, 2025
@ashish10alex ashish10alex requested a review from Copilot March 27, 2025 20:24
@ashish10alex ashish10alex marked this pull request as ready for review March 27, 2025 20:25
Copy link

@Copilot 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 adds support for multi-root workspaces by converting various workspace folder retrieval functions to asynchronous versions and wiring up a new workspace folder selection flow. Key changes include:

  • Converting getWorkspaceFolder calls to their async equivalents across multiple files.
  • Adding a new command and UI link for selecting the workspace folder.
  • Updating error messages in the webview to reflect multi-root workspace context.

Reviewed Changes

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

Show a summary per file
File Description
src/views/register-preview-compiled-panel.ts Updates command handling for workspace selection.
src/depedancyGraphPanel.ts Converts synchronous workspace retrieval to async.
src/utils.ts Refactors getWorkspaceFolder and related functions to async.
src/runTag.ts, src/runFilesTagsWtOptions.ts, src/runFiles.ts, src/hoverProvider.ts, src/formatCurrentFile.ts, src/extension.ts, src/dependancyTreeNodeMeta.ts, src/dependancyTree.ts, src/definitionProvider.ts Replaces synchronous calls with await for workspace folder retrieval.
src/constants.ts Revises error message generation to support multi-root workspaces.
media/js/showCompiledQuery.js Adds a UI link for workspace folder selection.

@ashish10alex ashish10alex added this to the v0.11.1 milestone Mar 27, 2025
@ashish10alex ashish10alex marked this pull request as draft April 6, 2025 11:01
Copy link

vercel bot commented Apr 8, 2025

Deployment failed with the following error:

Creating the Deployment Timed Out.

@ashish10alex ashish10alex removed this from the v0.11.1 milestone Apr 9, 2025
@ashish10alex ashish10alex marked this pull request as ready for review May 13, 2025 07:52
@ashish10alex ashish10alex requested a review from Copilot May 13, 2025 07:52
Copy link

@Copilot 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 PR introduces multi-root workspace support into the extension by making various functions asynchronous and integrating a new command to select the appropriate workspace folder.

  • Updated calls to getWorkspaceFolder to use async/await for better workflow handling
  • Added a new command 'selectWorkspaceFolder' and updated error messages and UI elements accordingly
  • Minor modifications in several files to incorporate multi-root awareness

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/views/register-preview-compiled-panel.ts Added handling for a new 'selectWorkspaceFolder' command
src/views/depedancyGraphPanel.ts Updated getWorkspaceFolder to be awaited for consistency
src/utils.ts Converted several functions to use async/await for fetching workspace folder
src/runTag.ts, runFilesTagsWtOptions.ts, etc. Updated workspaceFolder calls to use await
src/definitionProvider.ts Adjusted workspaceFolder retrieval to async mode
src/constants.ts Modified error message generation to include workspace folder details
package.json Registered the new selectWorkspaceFolder command
media/js/showCompiledQuery.js Added click handler for a UI element to trigger workspace selection
src/dependancyTreeNodeMeta.ts & src/dependancyTree.ts (File names contain a potential typo)
Comments suppressed due to low confidence (5)

src/depedancyGraphPanel.ts:1

  • [nitpick] The filename 'depedancyGraphPanel.ts' appears to be misspelled; consider renaming it to 'dependencyGraphPanel.ts' for clarity.
import * as vscode from 'vscode';

src/dependancyTree.ts:82

  • [nitpick] The filename 'dependancyTree.ts' seems misspelled; consider renaming it to 'dependencyTree.ts' for consistency.
if (!CACHED_COMPILED_DATAFORM_JSON) {

src/dependancyTreeNodeMeta.ts:85

  • [nitpick] The filename 'dependancyTreeNodeMeta.ts' appears to contain a typo; consider renaming it to 'dependencyTreeNodeMeta.ts' for clarity.
if (!CACHED_COMPILED_DATAFORM_JSON) {

src/utils.ts:175

  • [nitpick] Consider directly awaiting getWorkspaceFolder (e.g. 'let workspaceFolder = await getWorkspaceFolder();') during initialization instead of first assigning synchronously then conditionally awaiting, to maintain async consistency.
let workspaceFolder = getWorkspaceFolder();

src/constants.ts:39

  • The variable 'workspaceFolder' is used without being declared in the scope of getFileNotFoundErrorMessageForWebView. Please declare it (e.g. using 'let workspaceFolder = await getWorkspaceFolder();') before using it.
if(!workspaceFolder){

@ashish10alex ashish10alex merged commit 4fb8151 into main May 13, 2025
@ashish10alex ashish10alex deleted the feat/multi_root branch May 13, 2025 07:58
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