-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvscontext.mock.ts
37 lines (32 loc) · 935 Bytes
/
vscontext.mock.ts
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
import * as vscode from 'vscode';
let dummyMomentoData = {};
class DummyMemento implements vscode.Memento {
get<T>(key: string): Promise<T | undefined> {
return dummyMomentoData[key];
}
update(key: string, value: any): Promise<any> {
dummyMomentoData[key] = value;
return Promise.resolve(dummyMomentoData);
}
public setKeysForSync(keys: string[]): void {
return;
}
}
export const context: vscode.ExtensionContext = {
extensionPath: 'path',
storagePath: 'string',
logPath: 'string',
subscriptions: { dispose(): any { } }[0],
workspaceState: new DummyMemento(),
globalState: new DummyMemento(),
globalStoragePath: 'path',
asAbsolutePath(relativePath: string): string {
return '';
},
extensionUri: vscode.Uri.file(''),
environmentVariableCollection: null,
extensionMode: vscode.ExtensionMode.Test,
storageUri: undefined,
logUri: undefined,
globalStorageUri: undefined
};