-
Notifications
You must be signed in to change notification settings - Fork 73
feat: port readDirectoryRecursively from VSC #923
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
testFeatures.workspace.fs.readdir = path => fs.readdir(path, { withFileTypes: true }) | ||
testFeatures.workspace.fs.exists = path => | ||
fs.access(path).then( | ||
() => true, | ||
() => false | ||
) |
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.
TestFeatures
already provides stubs for all namespaces, so this should technically not be necessary. Unless you want to 'undo' the stubbing and go back to the real filesystem.
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.
Looking at the rest of the test, it's indeed easier just to defer to the actual filesystem than to stub out a bunch of recursive / nested calls to TestFeatures
. 👍
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.
Yeah I am intending to 'undo' the stubbing here, but most ways felt pretty awkward. This is the best solution I came up with, but lmk if you see a better option.
Problem
This utility function is needed for the agentic tools and currently lives in the VSC repo.
Solution
Notes
This PR contains some workarounds with TODO comments that can be properly addressed by aws/language-server-runtimes#415.
This same PR will also fix the warning on newer versions of node:
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.