-
Notifications
You must be signed in to change notification settings - Fork 3.7k
refactor: use ide.readFile instead of fs.readFile in static context service #8422
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
refactor: use ide.readFile instead of fs.readFile in static context service #8422
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.
No issues found across 1 file
|
@uinstinct I tried merging main into this branch but we still have a lot of test failures that must be coming from the changes here |
7be374d to
74af332
Compare
| if (entry.isDirectory()) { | ||
| // Skip common directories that typically don't contain source files | ||
| if (!shouldSkipDirectory(entry.name)) { | ||
| if (fileType === (2 as FileType.Directory)) { |
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.
I'm not familiar with the ide API, we're supposed to typecast 2 as FileType.Directory?
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.
Yes, actually FileType enum exists in a .d.ts file which has import issues when not used as a type
we have done this in few places such as:
continue/core/commands/slash/built-in-legacy/onboard.ts
Lines 75 to 76 in 1c1fce3
| entry[1] === (1 as FileType.File) || | |
| entry[1] === (2 as FileType.Directory), |
continue/core/util/filesystem.ts
Lines 110 to 113 in 1c1fce3
| ? (2 as FileType.Directory) | |
| : dirent.isSymbolicLink() | |
| ? (64 as FileType.SymbolicLink) | |
| : (1 as FileType.File), |
|
🎉 This PR is included in version 1.32.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
Use ide.readfile instead of fs.readfile in StaticContextService
resolves CON-4504
AI Code Review
@continue-reviewChecklist
Screen recording or screenshot
[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]
Tests
[ What tests were added or updated to ensure the changes work as expected? ]
Summary by cubic
Refactored StaticContextService to use IDE file APIs for reading files and scanning directories, improving support for URIs and virtual workspaces. Addresses CON-4504 by routing file access through the IDE layer.