11import { pull } from "lodash-es" ;
2- import type { EditableTextEditor , NotebookEditor , TextEditor } from "../.." ;
2+ import type {
3+ EditableTextEditor ,
4+ Messages ,
5+ NotebookEditor ,
6+ TextEditor ,
7+ } from "../.." ;
38import type { GeneralizedRange } from "../../types/GeneralizedRange" ;
49import type { TextDocument } from "../../types/TextDocument" ;
510import type { TextDocumentChangeEvent } from "../types/Events" ;
@@ -24,11 +29,11 @@ import FakeKeyValueStore from "./FakeKeyValueStore";
2429import FakeMessages from "./FakeMessages" ;
2530
2631export class FakeIDE implements IDE {
27- configuration : FakeConfiguration = new FakeConfiguration ( ) ;
28- messages : FakeMessages = new FakeMessages ( ) ;
29- keyValueStore : FakeKeyValueStore = new FakeKeyValueStore ( ) ;
30- clipboard : FakeClipboard = new FakeClipboard ( ) ;
31- capabilities : FakeCapabilities = new FakeCapabilities ( ) ;
32+ configuration = new FakeConfiguration ( ) ;
33+ keyValueStore = new FakeKeyValueStore ( ) ;
34+ clipboard = new FakeClipboard ( ) ;
35+ capabilities = new FakeCapabilities ( ) ;
36+ messages : Messages ;
3237
3338 runMode : RunMode = "test" ;
3439 cursorlessVersion : string = "0.0.0" ;
@@ -37,6 +42,10 @@ export class FakeIDE implements IDE {
3742 private assetsRoot_ : string | undefined ;
3843 private quickPickReturnValue : string | undefined = undefined ;
3944
45+ constructor ( messages : Messages = new FakeMessages ( ) ) {
46+ this . messages = messages ;
47+ }
48+
4049 async flashRanges ( _flashDescriptors : FlashDescriptor [ ] ) : Promise < void > {
4150 // empty
4251 }
@@ -57,8 +66,9 @@ export class FakeIDE implements IDE {
5766 dummyEvent ;
5867 onDidChangeTextEditorVisibleRanges : Event < TextEditorVisibleRangesChangeEvent > =
5968 dummyEvent ;
69+ onDidChangeTextDocument : Event < TextDocumentChangeEvent > = dummyEvent ;
6070
61- public mockAssetsRoot ( _assetsRoot : string ) {
71+ mockAssetsRoot ( _assetsRoot : string ) {
6272 this . assetsRoot_ = _assetsRoot ;
6373 }
6474
@@ -71,41 +81,41 @@ export class FakeIDE implements IDE {
7181 }
7282
7383 get activeTextEditor ( ) : TextEditor | undefined {
74- throw Error ( "Not implemented" ) ;
84+ throw Error ( "activeTextEditor: not implemented" ) ;
7585 }
7686
7787 get activeEditableTextEditor ( ) : EditableTextEditor | undefined {
78- throw Error ( "Not implemented" ) ;
88+ throw Error ( "activeEditableTextEditor: not implemented" ) ;
7989 }
8090
8191 get visibleTextEditors ( ) : TextEditor [ ] {
82- throw Error ( "Not implemented" ) ;
92+ return [ ] ;
8393 }
8494
8595 get visibleNotebookEditors ( ) : NotebookEditor [ ] {
86- throw Error ( "Not implemented" ) ;
96+ return [ ] ;
8797 }
8898
8999 public getEditableTextEditor ( _editor : TextEditor ) : EditableTextEditor {
90- throw Error ( "Not implemented" ) ;
100+ throw Error ( "getEditableTextEditor: not implemented" ) ;
91101 }
92102
93103 public findInDocument ( _query : string , _editor : TextEditor ) : Promise < void > {
94- throw Error ( "Not implemented" ) ;
104+ throw Error ( "findInDocument: not implemented" ) ;
95105 }
96106
97107 public findInWorkspace ( _query : string ) : Promise < void > {
98- throw Error ( "Not implemented" ) ;
108+ throw Error ( "findInWorkspace: not implemented" ) ;
99109 }
100110
101111 public openTextDocument ( _path : string ) : Promise < TextEditor > {
102- throw Error ( "Not implemented" ) ;
112+ throw Error ( "openTextDocument: not implemented" ) ;
103113 }
104114
105115 public openUntitledTextDocument (
106116 _options : OpenUntitledTextDocumentOptions ,
107117 ) : Promise < TextEditor > {
108- throw Error ( "Not implemented" ) ;
118+ throw Error ( "openUntitledTextDocument: not implemented" ) ;
109119 }
110120
111121 public setQuickPickReturnValue ( value : string | undefined ) {
@@ -120,17 +130,11 @@ export class FakeIDE implements IDE {
120130 }
121131
122132 public showInputBox ( _options ?: any ) : Promise < string | undefined > {
123- throw Error ( "Not implemented" ) ;
133+ throw Error ( "showInputBox: not implemented" ) ;
124134 }
125135
126136 executeCommand < T > ( _command : string , ..._args : any [ ] ) : Promise < T | undefined > {
127- throw new Error ( "Method not implemented." ) ;
128- }
129-
130- public onDidChangeTextDocument (
131- _listener : ( event : TextDocumentChangeEvent ) => void ,
132- ) : Disposable {
133- throw Error ( "Not implemented" ) ;
137+ throw new Error ( "executeCommand: not implemented" ) ;
134138 }
135139
136140 disposeOnExit ( ...disposables : Disposable [ ] ) : ( ) => void {
0 commit comments