Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/debug/test/browser/mockDebugModel.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { DisposableStore } from '../../../../../base/common/lifecycle.js';
7
import { NullLogService } from '../../../../../platform/log/common/log.js';
8
import { UriIdentityService } from '../../../../../platform/uriIdentity/common/uriIdentityService.js';
9
import { DebugModel } from '../../common/debugModel.js';
10
import { MockDebugStorage } from '../common/mockDebug.js';
11
import { TestFileService } from '../../../../test/browser/workbenchTestServices.js';
12
import { TestStorageService } from '../../../../test/common/workbenchTestServices.js';
13
14
const fileService = new TestFileService();
15
export const mockUriIdentityService = new UriIdentityService(fileService);
16
17
export function createMockDebugModel(disposable: Pick<DisposableStore, 'add'>): DebugModel {
18
const storage = disposable.add(new TestStorageService());
19
const debugStorage = disposable.add(new MockDebugStorage(storage));
20
return disposable.add(new DebugModel(debugStorage, <any>{ isDirty: (e: any) => false }, mockUriIdentityService, new NullLogService()));
21
}
22
23