UNPKG

901 BTypeScriptView Raw
1import type * as atomIde from "atom-ide-base";
2import { LanguageClientConnection, ApplyWorkspaceEditParams, ApplyWorkspaceEditResponse, WorkspaceEdit } from "../languageclient";
3import { TextBuffer } from "atom";
4/** Public: Adapts workspace/applyEdit commands to editors. */
5export default class ApplyEditAdapter {
6 /** Public: Attach to a {LanguageClientConnection} to receive edit events. */
7 static attach(connection: LanguageClientConnection): void;
8 /** Tries to apply edits and reverts if anything goes wrong. Returns the checkpoint, so the caller can revert changes if needed. */
9 static applyEdits(buffer: TextBuffer, edits: atomIde.TextEdit[]): number;
10 static onApplyEdit(params: ApplyWorkspaceEditParams): Promise<ApplyWorkspaceEditResponse>;
11 static apply(workspaceEdit: WorkspaceEdit): Promise<ApplyWorkspaceEditResponse>;
12 private static handleResourceOperation;
13}