-
-
Notifications
You must be signed in to change notification settings - Fork 29
Switch to VS Code file watching, replace fdir and picomatch with native file system APIs #418
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
base: master
Are you sure you want to change the base?
Conversation
|
@glenn2223 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs. I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review. |
Co-authored-by: glenn2223 <33450392+glenn2223@users.noreply.github.com>
|
Introduce a second watcher; this one will take on the responsibility of compiling all files when a partial file is saved. The current watcher will then only need to compile non-partial files. Does this drop the requirement for picomatch? |
…es, remove picomatch dependency Co-authored-by: glenn2223 <33450392+glenn2223@users.noreply.github.com>
I've implemented the separate watcher approach as requested. The new implementation features: Two Dedicated Watchers:
picomatch Dependency Removed: Benefits:
The implementation maintains backward compatibility while providing more precise change detection and compilation behavior. Commit: 4d73d65 |
…ng or encoding Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This PR addresses fundamental issues with file change detection and file system operations by migrating from VS Code's
onDidSaveTextDocumentevent to native file watching and replacing thefdirandpicomatchdependencies with VS Code's built-in file system APIs.Key Changes
Optimized File Watching Architecture
onDidSaveTextDocumentwith dualFileSystemWatchersetup for more comprehensive and efficient change detectionpartialsListpatterns and triggers compilation of ALL files when changes occurdisposeFileWatchers()when stopping watch modeFile System API Migration
fdirdependency completely from package.jsonpicomatchdependency and replaced with VS Code's native pattern matchingvscode.workspace.findFiles()for file discovery operationsRelativePatternfor include/exclude pattern matching with simple regex-based matching for common patternsBenefits
Better External Change Detection: The new file watching approach detects changes from:
Optimized Compilation Performance: The dual watcher architecture provides:
Improved Network Drive Support: Eliminates fdir-related issues with:
Enhanced Reliability: VS Code's native file system APIs provide:
Implementation Details
The migration maintains full backward compatibility with existing compilation logic while introducing more efficient file watching. The dual watcher setup ensures that partial file changes (which typically affect multiple output files) trigger full compilation, while non-partial file changes only compile the specific changed file for optimal performance.
File watchers are automatically set up when starting watch mode and properly disposed when stopping, preventing memory leaks and ensuring clean resource management.
Fixes #325.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.