Enhance $fs interface #373
-
Currently the whole interface from The type The type ProblemFrom the Proposal
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
This discussion emerged on Discord (link): @openscript: Now I've pulled VSCode and started analyzing the inlang extension inside a self built VS Code instance. He seems to be right. The extensions share a process. Some extensions start other processes (like the tsserver binary), which are children of the extensionHost process. There is a proxy between the extensionHost and the extensions. For example the proxy prevents calling process.exit. When we process.chdir() for other extensions the working directory is changed too. This is bad. You were right Samuel. To move forward we should use vscode.workspace.fs. There are a few steps to achieve this. First is to extend our own type/interface $fs, so it doesn't just use memfs but only the minimal fs inlang needs (currently readFile and writeFile). Unfortunately vscode.workspace.fss readFile and writeFile are not compatible with the ones from memfs or node:fs. So we need to have a proxy mapper inside the extension to map fs calls from the core to the vscode.workspace.fs. |
Beta Was this translation helpful? Give feedback.
-
I agree. Several questions: 1. Do we need to support the minimum filesystem API the current git implementation (isomorphic-git) needs, or do we leave that up to the "runtime"?The VSCode extension, for example, does not use the git implementation. Hence, filesystem APIs that are required for the "browser runtime" (that must use the git implementation) is not required for the IDE extension. 2. How do we solve the root problem of "different working directories"?The root problem is relative paths that are resolved differently from the host (editor/vscode extension) and |
Beta Was this translation helpful? Give feedback.
-
Ah, and the filesystem implementation that we define should be
The methodsProposal: (as you wrote) minimal surface area. if people need more APIs, they should open an issue.
|
Beta Was this translation helpful? Give feedback.
-
New filesystem API shipped recently. |
Beta Was this translation helpful? Give feedback.
New filesystem API shipped recently.