[File Watcher (node.js)] Error: ENAMETOOLONG: name too long
See this in the console of insiders.. Looks like some ad-hoc chat model is ending up being file watched
ERR [File Watcher (node.js)] Error: ENAMETOOLONG: name too long, stat '/^/vscode-copilot-chat-code-block/4b3e2ea8-fd64-4d09-b875-d9770d5e94d4/response_0/0#{"references":[{"uri":{"$mid":1,"fsPath":"/Users/jrieken/Code/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.ts","external":"file:/Users/jrieken/Code/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.ts","path":"/Users/jrieken/Code/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.ts","scheme":"file"},"range":{"startLineNumber":21,"startColumn":3,"endLineNumber":21,"endColumn":72}},{"uri":{"$mid":1,"fsPath":"/Users/jrieken/Code/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.ts","external":"file:/Users/jrieken/Code/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.ts","path":"/Users/jrieken/Code/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.ts","scheme":"file"},"range":{"startLineNumber":1,"startColumn":1,"endLineNumber":297,"endColumn":1}},{"uri":{"$mid":1,"fsPath":"/Users/jrieken/Code/vscode/src/vs/workbench/api/common/extHostWorkspace.ts","external":"file:/Users/jrieken/Code/vscode/src/vs/workbench/api/common/extHostWorkspace.ts","path":"/Users/jrieken/Code/vscode/src/vs/workbench/api/common/extHostWorkspace.ts","scheme":"file"},"range":{"startLineNumber":238,"startColumn":1,"endLineNumber":250,"endColumn":3}},{"uri":{"$mid":1,"fsPath":"/Users/jrieken/Code/vscode/src/vs/workbench/browser/web.main.ts","external":"file:/Users/jrieken/Code/vscode/src/vs/workbench/browser/web.main.ts","path":"/Users/jrieken/Code/vscode/src/vs/workbench/browser/path/to/inlineChatSessionService'
Possibly a TypeScript bug as the ^ indicates that the file is in-memory file. We shouldn't create any file watchers for it
Couldn't repro this in my testing. @jrieken do you remember what you did to cause this?
I can add defensive code here but would prefer to understand the root cause first
Not 100% sure but I think this happens when one of the code blocks is a valid module. Adding guards to not watch in-memory resources and also filed an issue against TS
Issue marked as unreleased but unable to locate closing commit in issue timeline. You can manually reference a commit by commenting `\closedWith someCommitSha`, or directly add the `insiders-released` label if you know this has already been releaased
verified in code
@mjbvz this is still happening, it looks like paths can also end with a ^:
/Users/bpasero/Development/Microsoft/vscode/^
Steps:
- run out of sources
- in
EventName.createDirectoryWatcherandEventName.createFileWatcherprint the paths that get watched - open the
vscodefolder - notice a path ending with
^comes in
I am not sure if its the same path, but I also see /^/review/ts-nul-authority in my selfhost file watcher logs.