@codingame/monaco-vscode-api 1.85.0-next.1 → 1.85.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/monaco.js
CHANGED
|
@@ -2,7 +2,7 @@ import { __decorate, __param } from './external/tslib/tslib.es6.js';
|
|
|
2
2
|
import { StandaloneServices, StandaloneKeybindingService } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
|
|
3
3
|
import { ITextResourceConfigurationService } from 'monaco-editor/esm/vs/editor/common/services/textResourceConfiguration.js';
|
|
4
4
|
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
5
|
-
import { StandaloneEditor, StandaloneDiffEditor2 } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditor.js';
|
|
5
|
+
import { StandaloneCodeEditor, StandaloneEditor, StandaloneDiffEditor2 } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditor.js';
|
|
6
6
|
import { isObject } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
7
7
|
import { distinct, deepClone } from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
8
8
|
export { errorHandler } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
@@ -53,57 +53,62 @@ function computeDiffConfiguration(configuration, overrides) {
|
|
|
53
53
|
Object.assign(editorConfiguration, deepClone(overrides));
|
|
54
54
|
return editorConfiguration;
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
updateEditorConfiguration() {
|
|
76
|
-
if (!this.hasModel() || this.textResourceConfigurationService == null) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
const resource = this.getModel().uri;
|
|
80
|
-
const configuration = this.textResourceConfigurationService.getValue(resource);
|
|
81
|
-
if (configuration == null) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
const editorConfiguration = computeConfiguration(configuration, this.optionsOverrides);
|
|
85
|
-
let editorSettingsToApply = editorConfiguration;
|
|
86
|
-
if (this.lastAppliedEditorOptions != null) {
|
|
87
|
-
editorSettingsToApply = distinct(this.lastAppliedEditorOptions, editorSettingsToApply);
|
|
56
|
+
function createConfiguredEditorClass(impl) {
|
|
57
|
+
let ConfiguredStandaloneEditor = class ConfiguredStandaloneEditor extends impl {
|
|
58
|
+
constructor(domElement, _options = {}, instantiationService, textResourceConfigurationService) {
|
|
59
|
+
const { theme, autoDetectHighContrast, model, value, language, accessibilityHelpUrl, ariaContainerElement, overflowWidgetsDomNode, dimension, ...options } = _options;
|
|
60
|
+
const computedOptions = computeConfiguration(textResourceConfigurationService.getValue(_options.model?.uri), options);
|
|
61
|
+
super(instantiationService, domElement, { ...computedOptions, overflowWidgetsDomNode, dimension, theme, autoDetectHighContrast, model, value, language, accessibilityHelpUrl, ariaContainerElement });
|
|
62
|
+
this.textResourceConfigurationService = textResourceConfigurationService;
|
|
63
|
+
this.optionsOverrides = {};
|
|
64
|
+
this.lastAppliedEditorOptions = computedOptions;
|
|
65
|
+
this.optionsOverrides = options;
|
|
66
|
+
this._register(textResourceConfigurationService.onDidChangeConfiguration((e) => {
|
|
67
|
+
const resource = this.getModel()?.uri;
|
|
68
|
+
if (resource != null && e.affectsConfiguration(resource, 'editor')) {
|
|
69
|
+
this.updateEditorConfiguration();
|
|
70
|
+
}
|
|
71
|
+
}));
|
|
72
|
+
this._register(this.onDidChangeModelLanguage(() => this.updateEditorConfiguration()));
|
|
73
|
+
this._register(this.onDidChangeModel(() => this.updateEditorConfiguration()));
|
|
74
|
+
this.updateEditorConfiguration();
|
|
88
75
|
}
|
|
89
|
-
|
|
90
|
-
this.
|
|
91
|
-
|
|
76
|
+
updateEditorConfiguration() {
|
|
77
|
+
if (!this.hasModel() || this.textResourceConfigurationService == null) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const resource = this.getModel().uri;
|
|
81
|
+
const configuration = this.textResourceConfigurationService.getValue(resource);
|
|
82
|
+
if (configuration == null) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const editorConfiguration = computeConfiguration(configuration, this.optionsOverrides);
|
|
86
|
+
let editorSettingsToApply = editorConfiguration;
|
|
87
|
+
if (this.lastAppliedEditorOptions != null) {
|
|
88
|
+
editorSettingsToApply = distinct(this.lastAppliedEditorOptions, editorSettingsToApply);
|
|
89
|
+
}
|
|
90
|
+
if (( Object.keys(editorSettingsToApply)).length > 0) {
|
|
91
|
+
this.lastAppliedEditorOptions = editorConfiguration;
|
|
92
|
+
super.updateOptions(editorSettingsToApply);
|
|
93
|
+
}
|
|
92
94
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
updateOptions(newOptions) {
|
|
96
|
+
this.optionsOverrides ?? (this.optionsOverrides = {});
|
|
97
|
+
const didChange = EditorOptionsUtil.applyUpdate(this.optionsOverrides, newOptions);
|
|
98
|
+
if (!didChange) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
this.updateEditorConfiguration();
|
|
99
102
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
};
|
|
104
|
+
ConfiguredStandaloneEditor = __decorate([
|
|
105
|
+
( __param(2, IInstantiationService)),
|
|
106
|
+
( __param(3, ITextResourceConfigurationService))
|
|
107
|
+
], ConfiguredStandaloneEditor);
|
|
108
|
+
return ConfiguredStandaloneEditor;
|
|
109
|
+
}
|
|
110
|
+
const ConfiguredStandaloneCodeEditor = createConfiguredEditorClass(createInjectedClass(StandaloneCodeEditor));
|
|
111
|
+
const ConfiguredStandaloneEditor = createConfiguredEditorClass(createInjectedClass(StandaloneEditor));
|
|
107
112
|
let ConfiguredStandaloneDiffEditor = class ConfiguredStandaloneDiffEditor extends createInjectedClass(StandaloneDiffEditor2) {
|
|
108
113
|
constructor(domElement, _options = {}, instantiationService, textResourceConfigurationService) {
|
|
109
114
|
const { theme, autoDetectHighContrast, modifiedAriaLabel, originalAriaLabel, overflowWidgetsDomNode, dimension, ...options } = _options;
|
|
@@ -151,7 +156,7 @@ let ConfiguredStandaloneDiffEditor = class ConfiguredStandaloneDiffEditor extend
|
|
|
151
156
|
this.updateEditorConfiguration();
|
|
152
157
|
}
|
|
153
158
|
_createInnerEditor(instantiationService, container, options) {
|
|
154
|
-
return instantiationService.createInstance(
|
|
159
|
+
return instantiationService.createInstance(ConfiguredStandaloneCodeEditor, container, options);
|
|
155
160
|
}
|
|
156
161
|
};
|
|
157
162
|
ConfiguredStandaloneDiffEditor = __decorate([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-api",
|
|
3
|
-
"version": "1.85.0
|
|
3
|
+
"version": "1.85.0",
|
|
4
4
|
"description": "VSCode public API plugged on the monaco editor",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": {
|
|
@@ -100,10 +100,10 @@
|
|
|
100
100
|
"dependencies": {
|
|
101
101
|
"monaco-editor": "0.45.0",
|
|
102
102
|
"vscode-semver": "npm:semver@=5.5.0",
|
|
103
|
-
"@codingame/monaco-vscode-layout-service-override": "1.85.0
|
|
104
|
-
"@codingame/monaco-vscode-environment-service-override": "1.85.0
|
|
105
|
-
"@codingame/monaco-vscode-extensions-service-override": "1.85.0
|
|
106
|
-
"@codingame/monaco-vscode-files-service-override": "1.85.0
|
|
107
|
-
"@codingame/monaco-vscode-quickaccess-service-override": "1.85.0
|
|
103
|
+
"@codingame/monaco-vscode-layout-service-override": "1.85.0",
|
|
104
|
+
"@codingame/monaco-vscode-environment-service-override": "1.85.0",
|
|
105
|
+
"@codingame/monaco-vscode-extensions-service-override": "1.85.0",
|
|
106
|
+
"@codingame/monaco-vscode-files-service-override": "1.85.0",
|
|
107
|
+
"@codingame/monaco-vscode-quickaccess-service-override": "1.85.0"
|
|
108
108
|
}
|
|
109
109
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ServiceIdentifier } from '../../../../platform/instantiation/common/instantiation.js';
|
|
2
2
|
import { Event } from '../../../../base/common/event.js';
|
|
3
|
-
import { IDisposable } from '../../../../base/common/lifecycle.js';
|
|
4
|
-
import { URI } from '../../../../base/common/uri.js';
|
|
5
3
|
import { RemoteTunnel, TunnelProtocol } from '../../../../platform/tunnel/common/tunnel.js';
|
|
4
|
+
import { IDisposable } from '../../../../base/common/lifecycle.js';
|
|
6
5
|
import { IEditableData } from '../../../common/views.js';
|
|
7
6
|
import { TunnelInformation, TunnelPrivacy } from '../../../../platform/remote/common/remoteAuthorityResolver.js';
|
|
7
|
+
import { URI } from '../../../../base/common/uri.js';
|
|
8
8
|
import { TunnelModel, TunnelProperties, Attributes, TunnelCloseReason, CandidatePort, TunnelSource } from './tunnelModel.js';
|
|
9
9
|
import { IExtensionPointUser } from '../../extensions/common/extensionsRegistry.js';
|
|
10
10
|
import { IExtensionDescription } from '../../../../platform/extensions/common/extensions.js';
|