-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
There was a problem hiding this 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. |
Deployment failed with the following error:
|
There was a problem hiding this 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){
Solves: #110
TODO: