Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/test/simulation/workbench/stores/runnerOptions.ts
13399 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 * as mobx from 'mobx';
7
import { SimulationStorage, SimulationStorageValue } from './simulationStorage';
8
9
export enum CacheMode {
10
Disable = 'disable', // never use the cache, don't update the cache
11
Require = 'require', // always use the cache, and fail if it's not available
12
Default = 'default', // use cache of available, but don't require it
13
Regenerate = 'regenerate', // regenerate the cache even if cache files are available
14
}
15
16
export class RunnerOptions {
17
public readonly grep: SimulationStorageValue<string>;
18
19
public readonly cacheMode: SimulationStorageValue<CacheMode>;
20
21
public readonly noFetch: SimulationStorageValue<boolean>;
22
23
public readonly n: SimulationStorageValue<string>;
24
25
public readonly additionalArgs: SimulationStorageValue<string>;
26
27
constructor(storage: SimulationStorage) {
28
this.grep = new SimulationStorageValue(storage, 'grep', '');
29
this.cacheMode = new SimulationStorageValue(storage, 'cacheMode', CacheMode.Default);
30
this.noFetch = new SimulationStorageValue(storage, 'noFetch', false);
31
this.n = new SimulationStorageValue(storage, 'n', '');
32
this.additionalArgs = new SimulationStorageValue(storage, 'additionalArgs', '');
33
mobx.makeObservable(this);
34
}
35
}
36
37