blob: 5368fb855db56ec63151980a85c43843397ae618 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
import * as vscode from "vscode";
import { TextEditor } from "vscode";
import MockDocument from "./MockDocument";
import MockSelection from "./MockSelection";
import MockTextEditorEdit from "./MockTextEditorEdit";
export default class MockEditor implements TextEditor {
public document: vscode.TextDocument;
public selection: vscode.Selection;
public selections: vscode.Selection[];
public options: vscode.TextEditorOptions;
public viewColumn?: vscode.ViewColumn;
public editBuilder: MockTextEditorEdit;
public constructor(s: MockSelection, d: MockDocument) {
this.selection = s;
this.document = d;
this.editBuilder = new MockTextEditorEdit();
}
public edit(callback: (editBuilder: vscode.TextEditorEdit) => void,
options?: { undoStopBefore: boolean; undoStopAfter: boolean; }): Thenable<boolean> {
callback(this.editBuilder);
return Promise.resolve(true);
}
public insertSnippet(snippet: vscode.SnippetString,
location?: vscode.Position | vscode.Range | vscode.Position[] | vscode.Range[],
options?: { undoStopBefore: boolean; undoStopAfter: boolean; }): Thenable<boolean> {
throw new Error("Method not implemented.");
}
public setDecorations(decorationType: vscode.TextEditorDecorationType,
rangesOrOptions: vscode.Range[] | vscode.DecorationOptions[]): void {
throw new Error("Method not implemented.");
}
public revealRange(range: vscode.Range, revealType?: vscode.TextEditorRevealType): void {
throw new Error("Method not implemented.");
}
public show(column?: vscode.ViewColumn): void {
throw new Error("Method not implemented.");
}
public hide(): void {
throw new Error("Method not implemented.");
}
}
|