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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ Improvements:
10
10
- Add MSVC linker error problem matching to the Problems pane. [#4675](https://github.com/microsoft/vscode-cmake-tools/pull/4675)[@bradphelan](https://github.com/bradphelan)
11
11
12
12
Bug Fixes:
13
+
- Fix spurious preset reloads triggered by unrelated file system events such as builds, git commits, and `cmake.copyCompileCommands`. Migrated file watching from chokidar to VS Code's built-in `FileSystemWatcher` API, which also resolves high CPU usage on Apple M1. [#4703](https://github.com/microsoft/vscode-cmake-tools/issues/4703)[#2967](https://github.com/microsoft/vscode-cmake-tools/issues/2967)
13
14
- Clarify that semicolons in `cmake.configureSettings` string values are escaped, and array notation should be used for CMake lists. [#4585](https://github.com/microsoft/vscode-cmake-tools/issues/4585)
14
15
- Fix "CMake: Quick Start" command failing silently when no folder is open. Now shows an error message with an option to open a folder. [#4504](https://github.com/microsoft/vscode-cmake-tools/issues/4504)
15
16
- Fix "CMake: Run Without Debugging" not changing the working directory when the build directory changes. [#4549](https://github.com/microsoft/vscode-cmake-tools/issues/4549)
@@ -1625,72 +1618,47 @@ export class PresetsController implements vscode.Disposable {
1625
1618
}
1626
1619
1627
1620
/**
1628
-
* FileWatcher is a wrapper around chokidar's FSWatcher that allows for watching multiple paths.
1629
-
* Chokidar's support for watching multiple paths is currently broken, if it is fixed in the future, this class can be removed.
1621
+
* FileWatcher watches an array of specific file paths using VS Code's built-in
1622
+
* vscode.workspace.createFileSystemWatcher API. This replaces the previous chokidar-based
1623
+
* implementation to eliminate spurious preset reloads triggered by unrelated file system
1624
+
* events (builds, git commits, copyCompileCommands). See issues #4703 and #2967.
1630
1625
*/
1631
1626
classFileWatcherimplementsvscode.Disposable{
1632
-
privatewatchers: Map<string,chokidar.FSWatcher>;
1633
-
// Debounce the change handler to avoid multiple changes being triggered by a single file change. Two change events are coming in rapid succession without this.
1627
+
privatewatchers: vscode.Disposable[]=[];
1628
+
// Debounce the change handler to avoid multiple changes being triggered by a single file change.
1629
+
// Two change events are coming in rapid succession without this.
1634
1630
privatecanRunChangeHandler=true;
1635
-
// Grace period flag to ignore events during watcher startup. When followSymlinks is false and
1636
-
// watched files are symlinks, chokidar may emit spurious events during initialization that
1637
-
// bypass ignoreInitial. This prevents infinite loops when reapplyPresets() recreates the watcher.
0 commit comments