MCPcopy Index your code
hub / github.com/devcontainers/cli / applyEdits

Method applyEdits

src/spec-configuration/editableFiles.ts:105–125  ·  view source on GitHub ↗
(uri: URI, edits: Edit[], content: string)

Source from the content-addressed store, hash-verified

103 }
104
105 async applyEdits(uri: URI, edits: Edit[], content: string) {
106 switch (uri.scheme) {
107 case RemoteDocuments.scheme:
108 try {
109 if (!RemoteDocuments.nonce) {
110 RemoteDocuments.nonce = crypto.randomUUID();
111 }
112 const result = jsonc.applyEdits(content, edits);
113 const eof = `EOF-${RemoteDocuments.nonce}`;
114 await this.shellServer.exec(`cat <<'${eof}' >${uri.path}
115${result}
116${eof}
117`);
118 } catch (err) {
119 console.log(err); // XXX
120 }
121 break;
122 default:
123 throw new Error(`Unsupported scheme: ${uri.toString()}`);
124 }
125 }
126}
127
128export class AllDocuments implements Documents {

Callers

nothing calls this directly

Calls 2

applyEditsMethod · 0.65
execMethod · 0.65

Tested by

no test coverage detected