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

Method syncFiles

src/cm/lsp/workspace.ts:131–147  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

129 }
130
131 syncFiles(): readonly WorkspaceFileUpdate[] {
132 const updates: WorkspaceFileUpdate[] = [];
133 for (const file of this.files) {
134 const view = file.getView();
135 if (!view) continue;
136 const plugin = LSPPlugin.get(view);
137 if (!plugin) continue;
138 const { unsyncedChanges } = plugin;
139 if (unsyncedChanges.empty) continue;
140
141 updates.push({ file, prevDoc: file.doc, changes: unsyncedChanges });
142 file.doc = view.state.doc;
143 file.version = this.#nextFileVersion(file.uri);
144 plugin.clear();
145 }
146 return updates;
147 }
148
149 openFile(uri: string, languageId: string, view: EditorView): void {
150 if (!view) return;

Callers

nothing calls this directly

Calls 4

#nextFileVersionMethod · 0.95
getViewMethod · 0.80
getMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected