MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / updateFile

Method updateFile

src/cm/lsp/workspace.ts:182–198  ·  view source on GitHub ↗
(uri: string, update: TransactionSpec)

Source from the content-addressed store, hash-verified

180 }
181
182 updateFile(uri: string, update: TransactionSpec): void {
183 const file = this.#getFileEntry(uri);
184
185 if (file) {
186 const view = file.getView();
187 if (view) {
188 view.dispatch(update);
189 return;
190 }
191 }
192
193 // File is not open - try to open it and apply the update
194 this.#applyUpdateToClosedFile(uri, update).catch((error) => {
195 this.#log("warn", `Workspace failed to apply update: ${uri}`, error);
196 console.warn(`[LSP:Workspace] Failed to apply update: ${uri}`, error);
197 });
198 }
199
200 async #applyUpdateToClosedFile(
201 uri: string,

Callers

nothing calls this directly

Calls 4

#getFileEntryMethod · 0.95
#logMethod · 0.95
getViewMethod · 0.80

Tested by

no test coverage detected