fix: nameFormat not respected in multi-root workspace - #247
Merged
douglasgomes98 merged 5 commits intoApr 20, 2026
Merged
Conversation
…onfig resolution vscode.workspace.getConfiguration requires a resource URI (not the workspace folder root) to resolve per-folder settings. Passing the workspace root caused nameFormat and other template settings to be ignored in multi-root workspaces. Adds multi-root workspace tests to createComponent and updateComponent verifying that each folder's config is resolved independently based on the clicked path. Closes #246 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…plates folder The manual startsWith check in findWorkspaceFolderUri had a path-prefix collision bug: a click inside /packages/application would incorrectly match /packages/app, causing templates to be looked up in the wrong workspace folder. Replace the custom implementation with vscode.workspace.getWorkspaceFolder(uri) which handles path boundary matching correctly. Add getWorkspaceFolder to the vscode mock as a plain function (immune to jest.resetAllMocks) that reads workspaceFolders dynamically with proper path separator and specificity sorting. Adds regression tests for the path-prefix collision scenario. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
Author
|
Update: Found and fixed a second related bug. The Fix: replaced the custom path-matching logic with |
Without scope: "resource", VS Code treats settings as window-scoped by default, which means .vscode/settings.json inside each workspace folder is silently ignored. Only .code-workspace file overrides were applied, so per-project templatesFolderPath and templateSettings were never picked up in multi-root workspaces. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Deleted .gitkeep files from components and services directories, along with their associated template files for component and service generation. This cleanup helps streamline the project structure by removing obsolete templates.
- src/helpers/fs/ and its tests: all fs wrappers were unused in production - src/helpers/vscode/getWorkspaceFolders.ts and its test: removed from commands in the multi-root workspace refactor - src/helpers/index.ts: barrel file never imported anywhere - Remove getWorkspaceFolders/WorkspaceFolder exports from vscode/index.ts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
douglasgomes98
deleted the
246-name-pattern-not-working-in-a-multi-root-workspace
branch
April 20, 2026 17:48
|
🎉 This PR is included in version 2.0.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nameFormat(and other template settings) being ignored when using a multi-root workspacereadConfigwas receiving the workspace folder root URI, butvscode.workspace.getConfigurationrequires a resource URI (the actual file/folder the user clicked) to resolve per-folder settings correctlyclickedUriinstead ofworkspaceFolderUritoreadConfigin bothcreateComponentandupdateComponentTest plan
multi-root workspacetest suite tocreateComponentandupdateComponentkebab-case)getConfigurationis called withclickedUri, not the workspace rootCloses #246
🤖 Generated with Claude Code