@codingame/monaco-vscode-assignment-service-override 20.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +17 -0
- package/index.js +46 -0
- package/package.json +46 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type IEditorOverrideServices } from "@codingame/monaco-vscode-api/vscode/vs/editor/standalone/browser/standaloneServices";
|
|
2
|
+
export interface Treatments {
|
|
3
|
+
"extensions.gallery.useResourceApi"?: "unpkg" | "marketplace";
|
|
4
|
+
useLatestPrereleaseAndStableVersionFlag?: boolean;
|
|
5
|
+
chatAgentMaxRequestsFree?: number;
|
|
6
|
+
chatAgentMaxRequestsPro?: number;
|
|
7
|
+
"chat.defaultModeFree"?: string;
|
|
8
|
+
"chat.defaultMode"?: string;
|
|
9
|
+
"chat.defaultLanguageModelFree"?: string;
|
|
10
|
+
"chat.defaultLanguageModel"?: string;
|
|
11
|
+
[key: `gettingStarted.overrideCategory.${string}.${string}.when`]: string;
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
}
|
|
14
|
+
export default function getServiceOverride({ experiments, treatments }?: {
|
|
15
|
+
experiments?: string[];
|
|
16
|
+
treatments?: Treatments;
|
|
17
|
+
}): IEditorOverrideServices;
|
package/index.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import '@codingame/monaco-vscode-api/vscode/vs/editor/standalone/browser/standaloneServices';
|
|
4
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
5
|
+
import { IEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/platform/environment/common/environment.service';
|
|
6
|
+
import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/descriptors';
|
|
7
|
+
import { IWorkbenchAssignmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/assignment/common/assignmentService.service';
|
|
8
|
+
|
|
9
|
+
let AssignmentService = class AssignmentService {
|
|
10
|
+
constructor(experiments, treatments, configurationService, environmentService) {
|
|
11
|
+
this.experiments = experiments;
|
|
12
|
+
this.treatments = treatments;
|
|
13
|
+
this.configurationService = configurationService;
|
|
14
|
+
this.experimentsEnabled =
|
|
15
|
+
!environmentService.disableExperiments &&
|
|
16
|
+
!environmentService.extensionTestsLocationURI &&
|
|
17
|
+
configurationService.getValue('workbench.enableExperiments') === true;
|
|
18
|
+
}
|
|
19
|
+
async getCurrentExperiments() {
|
|
20
|
+
if (!this.experimentsEnabled) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
return this.experiments;
|
|
24
|
+
}
|
|
25
|
+
async getTreatment(name) {
|
|
26
|
+
const override = this.configurationService.getValue(`experiments.override.${name}`);
|
|
27
|
+
if (override !== undefined) {
|
|
28
|
+
return override;
|
|
29
|
+
}
|
|
30
|
+
if (!this.experimentsEnabled) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
return this.treatments[name];
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
AssignmentService = __decorate([
|
|
37
|
+
__param(2, IConfigurationService),
|
|
38
|
+
__param(3, IEnvironmentService)
|
|
39
|
+
], AssignmentService);
|
|
40
|
+
function getServiceOverride({ experiments = [], treatments = {} } = {}) {
|
|
41
|
+
return {
|
|
42
|
+
[IWorkbenchAssignmentService.toString()]: new SyncDescriptor(AssignmentService, [experiments, treatments], true)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { getServiceOverride as default };
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@codingame/monaco-vscode-assignment-service-override",
|
|
3
|
+
"version": "20.2.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "VSCode public API plugged on the monaco editor - assignment service-override",
|
|
6
|
+
"keywords": [],
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "CodinGame",
|
|
9
|
+
"url": "http://www.codingame.com"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+ssh://git@github.com/CodinGame/monaco-vscode-api.git"
|
|
15
|
+
},
|
|
16
|
+
"type": "module",
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@codingame/monaco-vscode-api": "20.2.0"
|
|
19
|
+
},
|
|
20
|
+
"main": "index.js",
|
|
21
|
+
"module": "index.js",
|
|
22
|
+
"types": "index.d.ts",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"default": "./index.js"
|
|
26
|
+
},
|
|
27
|
+
"./vscode/*.css": {
|
|
28
|
+
"default": "./vscode/src/*.css"
|
|
29
|
+
},
|
|
30
|
+
"./vscode/*": {
|
|
31
|
+
"types": "./vscode/src/*.d.ts",
|
|
32
|
+
"default": "./vscode/src/*.js"
|
|
33
|
+
},
|
|
34
|
+
"./*": {
|
|
35
|
+
"types": "./*.d.ts",
|
|
36
|
+
"default": "./*.js"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"typesVersions": {
|
|
40
|
+
"*": {
|
|
41
|
+
"vscode/*": [
|
|
42
|
+
"./vscode/src/*.d.ts"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|