Clarify expected behaviour when a file does not exist for fs/read_text_file
#246
Replies: 2 comments
-
|
Came here with this same question, as for the model I am currently testing if it's the first read and it returns empty it traps itself in a loop! Would be nice to have defined behaviour for this case. |
Beta Was this translation helpful? Give feedback.
-
|
Hey all, I think the issue is that Zed has this behavior because if you opened up a buffer for a file that doesn't exist, you want an empty buffer for a file you can edit. But if the file doesn't exist and isn't open then I think we should probably return a resource not found error here, agreed |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I expected this method to return an error but the Zed Editor returned the empty string. This seems counterintuitive to me. Could we clearly document in the specification whether an error should return for a non-existent file (that also does not exist in the editor as an unsaved file) or if we should return
""?{ "jsonrpc": "2.0", "id": 0, "method": "fs/read_text_file", "params": { "path": "/Users/rcjsuen/abc/def/empty.txt", "sessionId": "d60f8bb6-dcd9-4fb8-8805-59b29f11dee1", "line": null, "limit": null } } { "jsonrpc": "2.0", "id": 0, "result": { "content": "" } }Beta Was this translation helpful? Give feedback.
All reactions