scripting tool: Use project buffers in io.open (#26425)

This PR makes `io.open` use our own implementation again, but instead of
the real filesystem, it will now use the project's to check file
metadata and perform read and writes using project buffers.

This also cleans up the `io.open` implementation by splitting it into
multiple methods, adds tests for various File I/O patterns, and fixes a
few bugs in read formats.

Release Notes:

- N/A
This commit is contained in:
Agus Zubiaga 2025-03-11 00:52:16 -03:00 committed by GitHub
parent d562f58e76
commit bf11b888c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 502 additions and 335 deletions

View file

@ -36,7 +36,7 @@ impl ScriptingTool {
};
// TODO: Store a session per thread
let session = cx.new(|cx| ScriptSession::new(project, cx));
let session = cx.new(|cx| ScriptingSession::new(project, cx));
let lua_script = input.lua_script;
let (script_id, script_task) =