failed to stat a resource for file watching
Repro steps: Open spring-petclinic.
MainThreadFileSystem#$watch(): failed to stat a resource for file watching (extension: vscjava.vscode-java-dependency, path: file:///c:/Users/yanzh/Desktop/spring-petclinic/target/generated-sources/annotations, recursive: true, session: 0.2511242984362432): EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, stat 'c:\Users\yanzh\Desktop\spring-petclinic\target\generated-sources\annotations'
Also occur in vscode-java-test extension.
ERR MainThreadFileSystem#$watch(): failed to stat a resource for file watching (extension: vscjava.vscode-java-dependency, path: file:///c:/Users/yanzh/Desktop/spring-petclinic/target/generated-sources/annotations, recursive: true, session: 0.21007677817315185): EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, stat 'c:\Users\yanzh\Desktop\spring-petclinic\target\generated-sources\annotations'
ERR MainThreadFileSystem#$watch(): failed to stat a resource for file watching (extension: vscjava.vscode-java-dependency, path: file:///c:/Users/yanzh/Desktop/spring-petclinic/target/generated-test-sources/test-annotations, recursive: true, session: 0.5921958898854154): EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, stat 'c:\Users\yanzh\Desktop\spring-petclinic\target\generated-test-sources\test-annotations'
ERR MainThreadFileSystem#$watch(): failed to stat a resource for file watching (extension: vscjava.vscode-java-test, path: file:///c:/Users/yanzh/Desktop/spring-petclinic/target/generated-test-sources/test-annotations, recursive: true, session: 0.48545096781711017): EntryNotFound (FileSystemError): Error: ENOENT: no such file or directory, stat 'c:\Users\yanzh\Desktop\spring-petclinic\target\generated-test-sources\test-annotations'
I found that though there is an error in the console, the file watcher works as expected after the folder is created on disk.
I filed an issue upstream: https://github.com/microsoft/vscode/issues/165025
Let's wait and see the response.