You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains 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
The parameters for the getMatchingPathsRecursive function in workspace-provider.js have been updated. The root path is combined with the directory name gotten from the packagesPathPattern and the RegExp pattern used in searching the packages is also modified.
PR Type
Bug fix
Description
Updated the getMatchingPathsRecursive function parameters in workspace-provider.js.
Combined rootPath with the directory name from packagesPathPattern.
Modified the RegExp pattern used for searching package.json files.
Changes walkthrough 📝
Relevant files
Bug fix
workspace-provider.js
Update `getMatchingPathsRecursive` parameters and RegExp pattern
…s in `workspace-provider.js`
The parameters for the `getMatchingPathsRecursive` function in `workspace-provider.js` have been updated. The root path is combined with the directory name gotten from the `packagesPathPattern` and the RegExp pattern used in searching the packages is also modified.
2, because the changes are limited to a single function in one file, and the modifications are straightforward involving parameter updates and a regular expression change.
🧪 Relevant tests
No
⚡ Possible issues
Possible Bug: The new RegExp pattern "/*/package.json" might not work as intended. The pattern seems to aim for any subdirectory, but in RegExp, * matches zero or more of the preceding element. This might result in incorrect or no path matches. Consider using ".*/package.json" to correctly match any subdirectory.
Correct the regular expression to match any directories containing package.json
Modify the regular expression to correctly match directories for package.json. The current expression "/*/package.json" might not work as intended. Use "/package.json" to match any directories.**
Why: The suggested change to the regular expression is crucial for correctly matching directories containing package.json. The current expression is likely incorrect, and this fix addresses a potential bug.
9
Best practice
Use path.resolve to ensure correct path resolution
Consider using path.resolve instead of path.join for constructing the path. path.resolve will handle cases where the packagesPathPattern might start with a slash, which could lead to incorrect paths when used with path.join.
Why: Using path.resolve can prevent potential issues with incorrect path resolution, especially if packagesPathPattern starts with a slash. This is a good practice to ensure robust path handling.
8
Enhancement
Add error handling for the getMatchingPathsRecursive function
Consider adding error handling for the getMatchingPathsRecursive function to manage cases where the path resolution fails or the regex does not match any files.
Why: Adding error handling is a good enhancement for robustness, ensuring that failures in path resolution or regex matching are properly managed and logged.
7
Possible issue
Verify the implementation of ignoreStartsWith to ensure it functions correctly
Ensure that the ignoreStartsWith option in the configuration object is correctly implemented to ignore paths starting with specified characters. Verify that the implementation of getMatchingPathsRecursive handles this configuration as expected.
-ignoreStartsWith: [ ".", "#" ]+ignoreStartsWith: [ ".", "#" ] // Ensure this is correctly implemented in getMatchingPathsRecursive
Suggestion importance[1-10]: 3
Why: While it's important to verify the implementation, this suggestion does not provide a concrete improvement to the code itself. It is more of a reminder than an actionable change.
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.
User description
…s in
workspace-provider.js
The parameters for the
getMatchingPathsRecursive
function inworkspace-provider.js
have been updated. The root path is combined with the directory name gotten from thepackagesPathPattern
and the RegExp pattern used in searching the packages is also modified.PR Type
Bug fix
Description
getMatchingPathsRecursive
function parameters inworkspace-provider.js
.rootPath
with the directory name frompackagesPathPattern
.package.json
files.Changes walkthrough 📝
workspace-provider.js
Update `getMatchingPathsRecursive` parameters and RegExp pattern
packages/zenflux-typescript-vm/src/providers/workspace-provider.js
getMatchingPathsRecursive
function parameters.rootPath
with the directory name frompackagesPathPattern
.