mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
sqlite - support in-memory when running ext tests
This commit is contained in:
parent
2dcc9b085c
commit
d68c05c3d9
|
@ -17,6 +17,8 @@ import { ShutdownReason } from 'vs/platform/lifecycle/common/lifecycle';
|
|||
export class StorageService extends Disposable implements IStorageService {
|
||||
_serviceBrand: any;
|
||||
|
||||
private static IN_MEMORY_PATH = ':memory:';
|
||||
|
||||
private _onDidChangeStorage: Emitter<IWorkspaceStorageChangeEvent> = this._register(new Emitter<IWorkspaceStorageChangeEvent>());
|
||||
get onDidChangeStorage(): Event<IWorkspaceStorageChangeEvent> { return this._onDidChangeStorage.event; }
|
||||
|
||||
|
@ -39,8 +41,10 @@ export class StorageService extends Disposable implements IStorageService {
|
|||
errorLogger: error => logService.error(error)
|
||||
};
|
||||
|
||||
this.globalStorage = new Storage({ path: ':memory:', logging: loggingOptions });
|
||||
this.workspaceStorage = new Storage({ path: workspaceDBPath, logging: loggingOptions });
|
||||
const useInMemoryStorage = !!environmentService.extensionTestsPath; // never keep any state when running extension tests
|
||||
|
||||
this.globalStorage = new Storage({ path: useInMemoryStorage ? StorageService.IN_MEMORY_PATH : StorageService.IN_MEMORY_PATH, logging: loggingOptions });
|
||||
this.workspaceStorage = new Storage({ path: useInMemoryStorage ? StorageService.IN_MEMORY_PATH : workspaceDBPath, logging: loggingOptions });
|
||||
|
||||
this.registerListeners();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue