mirror of
https://github.com/coder/code-server.git
synced 2026-05-10 22:37:26 +02:00
Partial extension host, some restructuring
I didn't like how the inner objects accessed parent objects, so I restructured all that.
This commit is contained in:
27
transformer.js
Normal file
27
transformer.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// This file is included via a regular Node require. I'm not sure how (or if)
|
||||
// we can write this in Typescript and have it compile to non-AMD syntax.
|
||||
module.exports = (remoteAuthority) => {
|
||||
return {
|
||||
transformIncoming: (uri) => {
|
||||
switch (uri.scheme) {
|
||||
case "vscode-remote": return { scheme: "file", path: uri.path };
|
||||
case "file ": return { scheme: "vscode-local", path: uri.path };
|
||||
default: return uri;
|
||||
}
|
||||
},
|
||||
transformOutgoing: (uri) => {
|
||||
switch (uri.scheme) {
|
||||
case "vscode-local": return { scheme: "file", path: uri.path };
|
||||
case "file ": return { scheme: "vscode-remote", authority: remoteAuthority, path: uri.path };
|
||||
default: return uri;
|
||||
}
|
||||
},
|
||||
transformOutgoingScheme: (scheme) => {
|
||||
switch (scheme) {
|
||||
case "vscode-local": return "file";
|
||||
case "file": return "vscode-remote";
|
||||
default: return scheme;
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user