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

Method #applyUpdateToClosedFile

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

Source from the content-addressed store, hash-verified

198 }
199
200 async #applyUpdateToClosedFile(
201 uri: string,
202 update: TransactionSpec,
203 ): Promise<void> {
204 if (typeof this.options.displayFile !== "function") return;
205
206 try {
207 const view = await this.options.displayFile(uri);
208 if (!view?.state?.doc) return;
209 const languageId = this.#resolveLanguageIdForUri(uri);
210 const file = this.#getOrCreateFile(uri, languageId, view);
211 const fileView = file.getView();
212 if (fileView) {
213 fileView.dispatch(update);
214 }
215 } catch (error) {
216 this.#log("error", `Workspace failed to apply update: ${uri}`, error);
217 console.error(`[LSP:Workspace] Failed to apply update: ${uri}`, error);
218 }
219 }
220
221 async displayFile(uri: string): Promise<EditorView | null> {
222 if (typeof this.options.displayFile === "function") {

Callers 1

updateFileMethod · 0.95

Calls 6

#getOrCreateFileMethod · 0.95
#logMethod · 0.95
displayFileMethod · 0.80
getViewMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected