@codingame/monaco-vscode-configuration-service-override 1.82.4 → 1.82.5-next.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/configuration.d.ts +15 -0
- package/configuration.js +118 -0
- package/external/tslib/tslib.es6.js +11 -0
- package/index.d.ts +5 -2
- package/index.js +2 -2
- package/override/vs/platform/dialogs/common/dialogs.js +8 -0
- package/package.json +2 -2
- package/tools.js +21 -0
- package/vscode/src/vs/editor/common/services/textResourceConfigurationService.js +118 -0
- package/vscode/src/vs/platform/configuration/common/configurationRegistry.js +11 -0
- package/vscode/src/vs/workbench/api/common/configurationExtensionPoint.js +451 -0
- package/vscode/src/vs/workbench/services/configuration/browser/configuration.js +880 -0
- package/vscode/src/vs/workbench/services/configuration/browser/configurationService.js +1172 -0
- package/vscode/src/vs/workbench/services/configuration/common/configurationCache.js +82 -0
- package/vscode/src/vs/workbench/services/configuration/common/configurationEditing.js +591 -0
- package/vscode/src/vs/workbench/services/configuration/common/configurationModels.js +121 -0
- package/vscode/src/vs/workbench/services/label/common/labelService.js +414 -0
- package/vscode/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.js +324 -0
- package/vscode/src/vs/workbench/services/workspaces/browser/workspacesService.js +153 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IEditorOverrideServices } from 'vscode/vscode/vs/editor/standalone/browser/standaloneServices';
|
|
2
|
+
import { IConfigurationRegistry } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
3
|
+
export { ConfigurationScope, IConfigurationDefaults, IConfigurationNode } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
4
|
+
import * as vscode from 'vscode';
|
|
5
|
+
import { IAnyWorkspaceIdentifier } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
6
|
+
export { IAnyWorkspaceIdentifier, IEmptyWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
7
|
+
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
8
|
+
|
|
9
|
+
declare function updateUserConfiguration(configurationJson: string): Promise<void>;
|
|
10
|
+
declare function getUserConfiguration(): Promise<string>;
|
|
11
|
+
declare function onUserConfigurationChange(callback: () => void): vscode.Disposable;
|
|
12
|
+
declare const configurationRegistry: IConfigurationRegistry;
|
|
13
|
+
declare function getServiceOverride(defaultWorkspace: URI | IAnyWorkspaceIdentifier): IEditorOverrideServices;
|
|
14
|
+
|
|
15
|
+
export { configurationRegistry, getServiceOverride as default, getUserConfiguration, onUserConfigurationChange, updateUserConfiguration };
|
package/configuration.js
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { __decorate, __param } from './external/tslib/tslib.es6.js';
|
|
2
|
+
import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
|
|
3
|
+
import { WorkspaceService } from './vscode/src/vs/workbench/services/configuration/browser/configurationService.js';
|
|
4
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
5
|
+
import { ITextResourceConfigurationService } from 'monaco-editor/esm/vs/editor/common/services/textResourceConfiguration.js';
|
|
6
|
+
import { TextResourceConfigurationService } from './vscode/src/vs/editor/common/services/textResourceConfigurationService.js';
|
|
7
|
+
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
8
|
+
export { ConfigurationScope } from './vscode/src/vs/platform/configuration/common/configurationRegistry.js';
|
|
9
|
+
import { Extensions } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
|
|
10
|
+
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
11
|
+
import { VSBuffer } from 'monaco-editor/esm/vs/base/common/buffer.js';
|
|
12
|
+
import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
13
|
+
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
14
|
+
import { IUserDataProfilesService } from 'monaco-editor/esm/vs/platform/userDataProfile/common/userDataProfile.js';
|
|
15
|
+
import { IPolicyService } from 'monaco-editor/esm/vs/platform/policy/common/policy.js';
|
|
16
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
17
|
+
import { IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile';
|
|
18
|
+
import { IRemoteAgentService } from 'vscode/vscode/vs/workbench/services/remote/common/remoteAgentService';
|
|
19
|
+
import { IUriIdentityService } from 'monaco-editor/esm/vs/platform/uriIdentity/common/uriIdentity.js';
|
|
20
|
+
import { ConfigurationCache } from './vscode/src/vs/workbench/services/configuration/common/configurationCache.js';
|
|
21
|
+
import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
22
|
+
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
|
|
23
|
+
import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
|
|
24
|
+
import { LabelService } from './vscode/src/vs/workbench/services/label/common/labelService.js';
|
|
25
|
+
import { ILabelService } from 'monaco-editor/esm/vs/platform/label/common/label.js';
|
|
26
|
+
import { generateUuid } from 'monaco-editor/esm/vs/base/common/uuid.js';
|
|
27
|
+
import { IWorkspacesService } from 'vscode/vscode/vs/platform/workspaces/common/workspaces';
|
|
28
|
+
import { BrowserWorkspacesService } from './vscode/src/vs/workbench/services/workspaces/browser/workspacesService.js';
|
|
29
|
+
import { IWorkspaceEditingService } from 'vscode/vscode/vs/workbench/services/workspaces/common/workspaceEditing';
|
|
30
|
+
import { AbstractWorkspaceEditingService } from './vscode/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.js';
|
|
31
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
32
|
+
import './vscode/src/vs/workbench/api/common/configurationExtensionPoint.js';
|
|
33
|
+
import getServiceOverride$1 from 'vscode/service-override/files';
|
|
34
|
+
import { memoizedConstructor, unsupported } from './tools.js';
|
|
35
|
+
import { registerServiceInitializePreParticipant } from 'vscode/lifecycle';
|
|
36
|
+
|
|
37
|
+
async function updateUserConfiguration(configurationJson) {
|
|
38
|
+
const userDataProfilesService = StandaloneServices.get(IUserDataProfilesService);
|
|
39
|
+
await StandaloneServices.get(IFileService).writeFile(userDataProfilesService.defaultProfile.settingsResource, VSBuffer.fromString(configurationJson));
|
|
40
|
+
}
|
|
41
|
+
async function getUserConfiguration() {
|
|
42
|
+
const userDataProfilesService = StandaloneServices.get(IUserDataProfilesService);
|
|
43
|
+
return ( (await StandaloneServices.get(IFileService).readFile(userDataProfilesService.defaultProfile.settingsResource)).value.toString());
|
|
44
|
+
}
|
|
45
|
+
function onUserConfigurationChange(callback) {
|
|
46
|
+
const userDataProfilesService = StandaloneServices.get(IUserDataProfilesService);
|
|
47
|
+
return StandaloneServices.get(IFileService).onDidFilesChange(e => {
|
|
48
|
+
if (e.affects(userDataProfilesService.defaultProfile.settingsResource)) {
|
|
49
|
+
callback();
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
const configurationRegistry = ( Registry.as(Extensions.Configuration));
|
|
54
|
+
let InjectedConfigurationService = class InjectedConfigurationService extends WorkspaceService {
|
|
55
|
+
constructor(workbenchEnvironmentService, userDataProfileService, userDataProfilesService, fileService, remoteAgentService, uriIdentityService, logService, policyService) {
|
|
56
|
+
const configurationCache = new ConfigurationCache([Schemas.file, Schemas.vscodeUserData, Schemas.tmp], workbenchEnvironmentService, fileService);
|
|
57
|
+
super({ configurationCache }, workbenchEnvironmentService, userDataProfileService, userDataProfilesService, fileService, remoteAgentService, uriIdentityService, logService, policyService);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
InjectedConfigurationService = __decorate([
|
|
61
|
+
( __param(0, IWorkbenchEnvironmentService)),
|
|
62
|
+
( __param(1, IUserDataProfileService)),
|
|
63
|
+
( __param(2, IUserDataProfilesService)),
|
|
64
|
+
( __param(3, IFileService)),
|
|
65
|
+
( __param(4, IRemoteAgentService)),
|
|
66
|
+
( __param(5, IUriIdentityService)),
|
|
67
|
+
( __param(6, ILogService)),
|
|
68
|
+
( __param(7, IPolicyService))
|
|
69
|
+
], InjectedConfigurationService);
|
|
70
|
+
class MonacoWorkspaceEditingService extends AbstractWorkspaceEditingService {
|
|
71
|
+
constructor() {
|
|
72
|
+
super(...arguments);
|
|
73
|
+
this.enterWorkspace = unsupported;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
let _defaultWorkspace = URI.file('/workspace');
|
|
77
|
+
registerServiceInitializePreParticipant(async (accessor) => {
|
|
78
|
+
const workspaceService = accessor.get(IWorkspaceContextService);
|
|
79
|
+
workspaceService.acquireInstantiationService(accessor.get(IInstantiationService));
|
|
80
|
+
if (URI.isUri(_defaultWorkspace)) {
|
|
81
|
+
const configPath = _defaultWorkspace.with({ path: '/workspace.code-workspace' });
|
|
82
|
+
try {
|
|
83
|
+
const fileService = accessor.get(IFileService);
|
|
84
|
+
await fileService.createFolder(_defaultWorkspace);
|
|
85
|
+
await fileService.writeFile(configPath, VSBuffer.fromString(JSON.stringify({
|
|
86
|
+
folders: [
|
|
87
|
+
{
|
|
88
|
+
path: _defaultWorkspace.path
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
})));
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
}
|
|
95
|
+
await workspaceService.initialize({
|
|
96
|
+
id: generateUuid(),
|
|
97
|
+
configPath
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
await workspaceService.initialize(_defaultWorkspace);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
const MemoizedInjectedConfigurationService = memoizedConstructor(InjectedConfigurationService);
|
|
105
|
+
function getServiceOverride(defaultWorkspace) {
|
|
106
|
+
_defaultWorkspace = defaultWorkspace;
|
|
107
|
+
return {
|
|
108
|
+
...getServiceOverride$1(),
|
|
109
|
+
[( ILabelService.toString())]: new SyncDescriptor(LabelService, undefined, true),
|
|
110
|
+
[( IConfigurationService.toString())]: new SyncDescriptor(MemoizedInjectedConfigurationService, [], true),
|
|
111
|
+
[( IWorkspaceContextService.toString())]: new SyncDescriptor(MemoizedInjectedConfigurationService, [], true),
|
|
112
|
+
[( ITextResourceConfigurationService.toString())]: new SyncDescriptor(TextResourceConfigurationService, [], true),
|
|
113
|
+
[( IWorkspaceEditingService.toString())]: new SyncDescriptor(MonacoWorkspaceEditingService, [], true),
|
|
114
|
+
[( IWorkspacesService.toString())]: new SyncDescriptor(BrowserWorkspacesService, undefined, true)
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export { configurationRegistry, getServiceOverride as default, getUserConfiguration, onUserConfigurationChange, updateUserConfiguration };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function __decorate(decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
}
|
|
7
|
+
function __param(paramIndex, decorator) {
|
|
8
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { __decorate, __param };
|
package/index.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export { default } from '
|
|
2
|
-
export
|
|
1
|
+
export { configurationRegistry, default, getUserConfiguration, onUserConfigurationChange, updateUserConfiguration } from './configuration.js';
|
|
2
|
+
export { ConfigurationScope, IConfigurationDefaults, IConfigurationNode } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
3
|
+
export { IColorCustomizations, IThemeScopedColorCustomizations } from 'vscode/vscode/vs/workbench/services/themes/common/workbenchThemeService';
|
|
4
|
+
export { IAnyWorkspaceIdentifier, IEmptyWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
5
|
+
export { IWorkspaceFolderCreationData } from 'vscode/vscode/vs/platform/workspaces/common/workspaces';
|
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from '
|
|
2
|
-
export
|
|
1
|
+
export { configurationRegistry, default, getUserConfiguration, onUserConfigurationChange, updateUserConfiguration } from './configuration.js';
|
|
2
|
+
export { ConfigurationScope } from './vscode/src/vs/platform/configuration/common/configurationRegistry.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var ConfirmResult;
|
|
2
|
+
( (function(ConfirmResult) {
|
|
3
|
+
ConfirmResult[ConfirmResult["SAVE"] = 0] = "SAVE";
|
|
4
|
+
ConfirmResult[ConfirmResult["DONT_SAVE"] = 1] = "DONT_SAVE";
|
|
5
|
+
ConfirmResult[ConfirmResult["CANCEL"] = 2] = "CANCEL";
|
|
6
|
+
})(ConfirmResult || (ConfirmResult = {})));
|
|
7
|
+
|
|
8
|
+
export { ConfirmResult };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-configuration-service-override",
|
|
3
|
-
"version": "1.82.
|
|
3
|
+
"version": "1.82.5-next.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@1.82.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.82.5-next.0",
|
|
22
22
|
"monaco-editor": "0.43.0"
|
|
23
23
|
}
|
|
24
24
|
}
|
package/tools.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function unsupported() {
|
|
2
|
+
throw new Error('unsupported');
|
|
3
|
+
}
|
|
4
|
+
function memoized(fct) {
|
|
5
|
+
let v = null;
|
|
6
|
+
return (...args) => {
|
|
7
|
+
if (v == null) {
|
|
8
|
+
v = fct(...args);
|
|
9
|
+
}
|
|
10
|
+
return v;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function memoizedConstructor(ctor) {
|
|
14
|
+
return new Proxy(ctor, {
|
|
15
|
+
construct: memoized((target, args) => {
|
|
16
|
+
return Reflect.construct(ctor, args);
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { memoized, memoizedConstructor, unsupported };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
3
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
|
+
import { Position } from 'monaco-editor/esm/vs/editor/common/core/position.js';
|
|
5
|
+
import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
|
|
6
|
+
import { IModelService } from 'monaco-editor/esm/vs/editor/common/services/model.js';
|
|
7
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
8
|
+
|
|
9
|
+
let TextResourceConfigurationService = class TextResourceConfigurationService extends Disposable {
|
|
10
|
+
constructor(configurationService, modelService, languageService) {
|
|
11
|
+
super();
|
|
12
|
+
this.configurationService = configurationService;
|
|
13
|
+
this.modelService = modelService;
|
|
14
|
+
this.languageService = languageService;
|
|
15
|
+
this._onDidChangeConfiguration = this._register(( new Emitter()));
|
|
16
|
+
this.onDidChangeConfiguration = this._onDidChangeConfiguration.event;
|
|
17
|
+
this._register(this.configurationService.onDidChangeConfiguration(e => this._onDidChangeConfiguration.fire(this.toResourceConfigurationChangeEvent(e))));
|
|
18
|
+
}
|
|
19
|
+
getValue(resource, arg2, arg3) {
|
|
20
|
+
if (typeof arg3 === 'string') {
|
|
21
|
+
return this._getValue(resource, Position.isIPosition(arg2) ? arg2 : null, arg3);
|
|
22
|
+
}
|
|
23
|
+
return this._getValue(resource, null, typeof arg2 === 'string' ? arg2 : undefined);
|
|
24
|
+
}
|
|
25
|
+
updateValue(resource, key, value, configurationTarget) {
|
|
26
|
+
const language = this.getLanguage(resource, null);
|
|
27
|
+
const configurationValue = this.configurationService.inspect(key, { resource, overrideIdentifier: language });
|
|
28
|
+
if (configurationTarget === undefined) {
|
|
29
|
+
configurationTarget = this.deriveConfigurationTarget(configurationValue, language);
|
|
30
|
+
}
|
|
31
|
+
switch (configurationTarget) {
|
|
32
|
+
case 8 :
|
|
33
|
+
return this._updateValue(key, value, configurationTarget, configurationValue.memory?.override, resource, language);
|
|
34
|
+
case 6 :
|
|
35
|
+
return this._updateValue(key, value, configurationTarget, configurationValue.workspaceFolder?.override, resource, language);
|
|
36
|
+
case 5 :
|
|
37
|
+
return this._updateValue(key, value, configurationTarget, configurationValue.workspace?.override, resource, language);
|
|
38
|
+
case 4 :
|
|
39
|
+
return this._updateValue(key, value, configurationTarget, configurationValue.userRemote?.override, resource, language);
|
|
40
|
+
default:
|
|
41
|
+
return this._updateValue(key, value, configurationTarget, configurationValue.userLocal?.override, resource, language);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
_updateValue(key, value, configurationTarget, overriddenValue, resource, language) {
|
|
45
|
+
if (language && overriddenValue !== undefined) {
|
|
46
|
+
return this.configurationService.updateValue(key, value, { resource, overrideIdentifier: language }, configurationTarget);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return this.configurationService.updateValue(key, value, { resource }, configurationTarget);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
deriveConfigurationTarget(configurationValue, language) {
|
|
53
|
+
if (language) {
|
|
54
|
+
if (configurationValue.memory?.override !== undefined) {
|
|
55
|
+
return 8 ;
|
|
56
|
+
}
|
|
57
|
+
if (configurationValue.workspaceFolder?.override !== undefined) {
|
|
58
|
+
return 6 ;
|
|
59
|
+
}
|
|
60
|
+
if (configurationValue.workspace?.override !== undefined) {
|
|
61
|
+
return 5 ;
|
|
62
|
+
}
|
|
63
|
+
if (configurationValue.userRemote?.override !== undefined) {
|
|
64
|
+
return 4 ;
|
|
65
|
+
}
|
|
66
|
+
if (configurationValue.userLocal?.override !== undefined) {
|
|
67
|
+
return 3 ;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (configurationValue.memory?.value !== undefined) {
|
|
71
|
+
return 8 ;
|
|
72
|
+
}
|
|
73
|
+
if (configurationValue.workspaceFolder?.value !== undefined) {
|
|
74
|
+
return 6 ;
|
|
75
|
+
}
|
|
76
|
+
if (configurationValue.workspace?.value !== undefined) {
|
|
77
|
+
return 5 ;
|
|
78
|
+
}
|
|
79
|
+
if (configurationValue.userRemote?.value !== undefined) {
|
|
80
|
+
return 4 ;
|
|
81
|
+
}
|
|
82
|
+
return 3 ;
|
|
83
|
+
}
|
|
84
|
+
_getValue(resource, position, section) {
|
|
85
|
+
const language = resource ? this.getLanguage(resource, position) : undefined;
|
|
86
|
+
if (typeof section === 'undefined') {
|
|
87
|
+
return this.configurationService.getValue({ resource, overrideIdentifier: language });
|
|
88
|
+
}
|
|
89
|
+
return this.configurationService.getValue(section, { resource, overrideIdentifier: language });
|
|
90
|
+
}
|
|
91
|
+
inspect(resource, position, section) {
|
|
92
|
+
const language = resource ? this.getLanguage(resource, position) : undefined;
|
|
93
|
+
return this.configurationService.inspect(section, { resource, overrideIdentifier: language });
|
|
94
|
+
}
|
|
95
|
+
getLanguage(resource, position) {
|
|
96
|
+
const model = this.modelService.getModel(resource);
|
|
97
|
+
if (model) {
|
|
98
|
+
return position ? model.getLanguageIdAtPosition(position.lineNumber, position.column) : model.getLanguageId();
|
|
99
|
+
}
|
|
100
|
+
return this.languageService.guessLanguageIdByFilepathOrFirstLine(resource);
|
|
101
|
+
}
|
|
102
|
+
toResourceConfigurationChangeEvent(configurationChangeEvent) {
|
|
103
|
+
return {
|
|
104
|
+
affectedKeys: configurationChangeEvent.affectedKeys,
|
|
105
|
+
affectsConfiguration: (resource, configuration) => {
|
|
106
|
+
const overrideIdentifier = resource ? this.getLanguage(resource, null) : undefined;
|
|
107
|
+
return configurationChangeEvent.affectsConfiguration(configuration, { resource, overrideIdentifier });
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
TextResourceConfigurationService = ( __decorate([
|
|
113
|
+
( __param(0, IConfigurationService)),
|
|
114
|
+
( __param(1, IModelService)),
|
|
115
|
+
( __param(2, ILanguageService))
|
|
116
|
+
], TextResourceConfigurationService));
|
|
117
|
+
|
|
118
|
+
export { TextResourceConfigurationService };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var ConfigurationScope;
|
|
2
|
+
( (function(ConfigurationScope) {
|
|
3
|
+
ConfigurationScope[ConfigurationScope["APPLICATION"] = 1] = "APPLICATION";
|
|
4
|
+
ConfigurationScope[ConfigurationScope["MACHINE"] = 2] = "MACHINE";
|
|
5
|
+
ConfigurationScope[ConfigurationScope["WINDOW"] = 3] = "WINDOW";
|
|
6
|
+
ConfigurationScope[ConfigurationScope["RESOURCE"] = 4] = "RESOURCE";
|
|
7
|
+
ConfigurationScope[ConfigurationScope["LANGUAGE_OVERRIDABLE"] = 5] = "LANGUAGE_OVERRIDABLE";
|
|
8
|
+
ConfigurationScope[ConfigurationScope["MACHINE_OVERRIDABLE"] = 6] = "MACHINE_OVERRIDABLE";
|
|
9
|
+
})(ConfigurationScope || (ConfigurationScope = {})));
|
|
10
|
+
|
|
11
|
+
export { ConfigurationScope };
|