@theia/monaco 1.57.1 → 1.58.1
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/README.md +3 -3
- package/lib/browser/markdown-renderer/monaco-markdown-renderer.d.ts +1 -1
- package/lib/browser/markdown-renderer/monaco-markdown-renderer.d.ts.map +1 -1
- package/lib/browser/markdown-renderer/monaco-markdown-renderer.js +1 -1
- package/lib/browser/markdown-renderer/monaco-markdown-renderer.js.map +1 -1
- package/lib/browser/monaco-diff-editor.js +2 -2
- package/lib/browser/monaco-diff-editor.js.map +1 -1
- package/lib/browser/monaco-editor-model.d.ts.map +1 -1
- package/lib/browser/monaco-editor-model.js +2 -2
- package/lib/browser/monaco-editor-model.js.map +1 -1
- package/lib/browser/monaco-editor.d.ts.map +1 -1
- package/lib/browser/monaco-editor.js +7 -4
- package/lib/browser/monaco-editor.js.map +1 -1
- package/lib/browser/monaco-frontend-application-contribution.d.ts +5 -0
- package/lib/browser/monaco-frontend-application-contribution.d.ts.map +1 -1
- package/lib/browser/monaco-frontend-application-contribution.js +21 -1
- package/lib/browser/monaco-frontend-application-contribution.js.map +1 -1
- package/lib/browser/monaco-frontend-module.d.ts +1 -1
- package/lib/browser/monaco-frontend-module.d.ts.map +1 -1
- package/lib/browser/monaco-frontend-module.js +2 -1
- package/lib/browser/monaco-frontend-module.js.map +1 -1
- package/lib/browser/monaco-init.d.ts.map +1 -1
- package/lib/browser/monaco-init.js +7 -16
- package/lib/browser/monaco-init.js.map +1 -1
- package/lib/browser/monaco-quick-input-service.d.ts +15 -5
- package/lib/browser/monaco-quick-input-service.d.ts.map +1 -1
- package/lib/browser/monaco-quick-input-service.js +33 -22
- package/lib/browser/monaco-quick-input-service.js.map +1 -1
- package/lib/browser/monaco-workspace.d.ts +2 -1
- package/lib/browser/monaco-workspace.d.ts.map +1 -1
- package/lib/browser/monaco-workspace.js +3 -2
- package/lib/browser/monaco-workspace.js.map +1 -1
- package/lib/browser/simple-monaco-editor.d.ts +1 -1
- package/lib/browser/simple-monaco-editor.d.ts.map +1 -1
- package/lib/browser/simple-monaco-editor.js +3 -2
- package/lib/browser/simple-monaco-editor.js.map +1 -1
- package/package.json +10 -10
- package/src/browser/markdown-renderer/monaco-markdown-renderer.ts +2 -1
- package/src/browser/monaco-diff-editor.ts +1 -1
- package/src/browser/monaco-editor-model.ts +3 -3
- package/src/browser/monaco-editor.ts +17 -4
- package/src/browser/monaco-frontend-application-contribution.ts +23 -2
- package/src/browser/monaco-frontend-module.ts +7 -6
- package/src/browser/monaco-init.ts +8 -17
- package/src/browser/monaco-quick-input-service.ts +47 -31
- package/src/browser/monaco-workspace.ts +4 -2
- package/src/browser/simple-monaco-editor.ts +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-monaco-editor.js","sourceRoot":"","sources":["../../src/browser/simple-monaco-editor.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,mDAA6F;AAE7F,
|
|
1
|
+
{"version":3,"file":"simple-monaco-editor.js","sourceRoot":"","sources":["../../src/browser/simple-monaco-editor.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,mDAA6F;AAE7F,yHAAgJ;AAChJ,gHAAqH;AACrH,sHAAmH;AACnH,wHAAqH;AACrH,sCAA6G;AAG7G,oDAAoD;AACpD,oEAAmE;AA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A+C;QAC9F,IAAI,SAAS,IAAI,SAAS,CAAC,KAAK,IAAI,CAAC,IAAI,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;YAC7D,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,MAAM,SAAS,GAAG,qBAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAEjD,MAAM,KAAK,GAAG,CAAC,CAAC,SAAS,IAAI,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;YAC/C,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;YACpC,SAAS,CAAC,KAAK,CAAC;QAEpB,MAAM,MAAM,GAAG,CAAC,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;YACjD,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;YACrC,SAAS,CAAC,MAAM,CAAC;QAErB,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAC7B,CAAC;IAES,QAAQ,CAAC,QAAqB,EAAE,SAAgC;QACtE,OAAO,QAAQ,CAAC,WAAW,GAAG,SAAS,CAAC,aAAa,CAAC;IAC1D,CAAC;IAES,SAAS,CAAC,QAAqB,EAAE,SAAgC;QACvE,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC;IAC1C,CAAC;IAED,OAAO;QACH,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;CAEJ;AArMD,gDAqMC"}
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/monaco",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.58.1",
|
|
4
4
|
"description": "Theia - Monaco Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.
|
|
7
|
-
"@theia/editor": "1.
|
|
8
|
-
"@theia/filesystem": "1.
|
|
9
|
-
"@theia/markers": "1.
|
|
10
|
-
"@theia/monaco-editor-core": "1.
|
|
11
|
-
"@theia/outline-view": "1.
|
|
12
|
-
"@theia/workspace": "1.
|
|
6
|
+
"@theia/core": "1.58.1",
|
|
7
|
+
"@theia/editor": "1.58.1",
|
|
8
|
+
"@theia/filesystem": "1.58.1",
|
|
9
|
+
"@theia/markers": "1.58.1",
|
|
10
|
+
"@theia/monaco-editor-core": "1.96.302",
|
|
11
|
+
"@theia/outline-view": "1.58.1",
|
|
12
|
+
"@theia/workspace": "1.58.1",
|
|
13
13
|
"fast-plist": "^0.1.2",
|
|
14
14
|
"idb": "^4.0.5",
|
|
15
15
|
"jsonc-parser": "^2.2.0",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"watch": "theiaext watch"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@theia/ext-scripts": "1.
|
|
55
|
+
"@theia/ext-scripts": "1.58.1"
|
|
56
56
|
},
|
|
57
57
|
"nyc": {
|
|
58
58
|
"extends": "../../configs/nyc.json"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "39f65022e1a40b95e4c1972d6cd3c7bf896187ce"
|
|
61
61
|
}
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
|
|
18
18
|
import { ILanguageService } from '@theia/monaco-editor-core/esm/vs/editor/common/languages/language';
|
|
19
|
-
import { MarkdownRenderer as CodeMarkdownRenderer, IMarkdownRendererOptions }
|
|
19
|
+
import { MarkdownRenderer as CodeMarkdownRenderer, IMarkdownRendererOptions }
|
|
20
|
+
from '@theia/monaco-editor-core/esm/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer';
|
|
20
21
|
import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices';
|
|
21
22
|
import * as monaco from '@theia/monaco-editor-core';
|
|
22
23
|
import { OpenerService, PreferenceService, WidgetOpenerOptions, open } from '@theia/core/lib/browser';
|
|
@@ -26,7 +26,7 @@ import { ICodeEditor, IDiffEditorConstructionOptions } from '@theia/monaco-edito
|
|
|
26
26
|
import { IActionDescriptor, IStandaloneCodeEditor, IStandaloneDiffEditor, StandaloneCodeEditor, StandaloneDiffEditor2 }
|
|
27
27
|
from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneCodeEditor';
|
|
28
28
|
import { IEditorConstructionOptions } from '@theia/monaco-editor-core/esm/vs/editor/browser/config/editorConfiguration';
|
|
29
|
-
import { EmbeddedDiffEditorWidget } from '@theia/monaco-editor-core/esm/vs/editor/browser/widget/
|
|
29
|
+
import { EmbeddedDiffEditorWidget } from '@theia/monaco-editor-core/esm/vs/editor/browser/widget/diffEditor/embeddedDiffEditorWidget';
|
|
30
30
|
import { IInstantiationService } from '@theia/monaco-editor-core/esm/vs/platform/instantiation/common/instantiation';
|
|
31
31
|
import { ContextKeyValue, IContextKey } from '@theia/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey';
|
|
32
32
|
import { IDisposable } from '@theia/monaco-editor-core/esm/vs/base/common/lifecycle';
|
|
@@ -19,7 +19,7 @@ import { TextEditorDocument, EncodingMode, FindMatchesOptions, FindMatch, Editor
|
|
|
19
19
|
import { DisposableCollection, Disposable } from '@theia/core/lib/common/disposable';
|
|
20
20
|
import { Emitter, Event } from '@theia/core/lib/common/event';
|
|
21
21
|
import { CancellationTokenSource, CancellationToken } from '@theia/core/lib/common/cancellation';
|
|
22
|
-
import { Resource, ResourceError, ResourceVersion
|
|
22
|
+
import { Resource, ResourceError, ResourceVersion } from '@theia/core/lib/common/resource';
|
|
23
23
|
import { Saveable, SaveOptions } from '@theia/core/lib/browser/saveable';
|
|
24
24
|
import { MonacoToProtocolConverter } from './monaco-to-protocol-converter';
|
|
25
25
|
import { ProtocolToMonacoConverter } from './protocol-to-monaco-converter';
|
|
@@ -202,7 +202,7 @@ export class MonacoEditorModel implements IResolvedTextEditorModel, TextEditorDo
|
|
|
202
202
|
const languageSelection = StandaloneServices.get(ILanguageService).createByFilepathOrFirstLine(uri, firstLine);
|
|
203
203
|
this.model = StandaloneServices.get(IModelService).createModel(value, languageSelection, uri);
|
|
204
204
|
this.resourceVersion = this.resource.version;
|
|
205
|
-
this.setDirty(this._dirty || (this.resource.
|
|
205
|
+
this.setDirty(this._dirty || (!!this.resource.initiallyDirty));
|
|
206
206
|
this.updateSavedVersionId();
|
|
207
207
|
this.toDispose.push(this.model);
|
|
208
208
|
this.toDispose.push(this.model.onDidChangeContent(event => this.fireDidChangeContent(event)));
|
|
@@ -553,7 +553,7 @@ export class MonacoEditorModel implements IResolvedTextEditorModel, TextEditorDo
|
|
|
553
553
|
}
|
|
554
554
|
|
|
555
555
|
const changes = [...this.contentChanges];
|
|
556
|
-
if (changes.length === 0 && !overwriteEncoding && reason !== TextDocumentSaveReason.Manual) {
|
|
556
|
+
if ((changes.length === 0 && !this.resource.initiallyDirty) && !overwriteEncoding && reason !== TextDocumentSaveReason.Manual) {
|
|
557
557
|
return;
|
|
558
558
|
}
|
|
559
559
|
|
|
@@ -51,7 +51,7 @@ import { ICodeEditor, IMouseTargetMargin } from '@theia/monaco-editor-core/esm/v
|
|
|
51
51
|
import { IStandaloneEditorConstructionOptions, StandaloneCodeEditor, StandaloneEditor } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneCodeEditor';
|
|
52
52
|
import { ServiceCollection } from '@theia/monaco-editor-core/esm/vs/platform/instantiation/common/serviceCollection';
|
|
53
53
|
import { MarkdownString } from '@theia/core/lib/common/markdown-rendering';
|
|
54
|
-
import { ConfigurationChangedEvent, IEditorOptions } from '@theia/monaco-editor-core/esm/vs/editor/common/config/editorOptions';
|
|
54
|
+
import { ConfigurationChangedEvent, IEditorOptions, ShowLightbulbIconMode } from '@theia/monaco-editor-core/esm/vs/editor/common/config/editorOptions';
|
|
55
55
|
import { ICodeEditorService } from '@theia/monaco-editor-core/esm/vs/editor/browser/services/codeEditorService';
|
|
56
56
|
import { ICommandService } from '@theia/monaco-editor-core/esm/vs/platform/commands/common/commands';
|
|
57
57
|
import { IContextKeyService } from '@theia/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey';
|
|
@@ -63,6 +63,7 @@ import { ILanguageConfigurationService } from '@theia/monaco-editor-core/esm/vs/
|
|
|
63
63
|
import { ILanguageFeaturesService } from '@theia/monaco-editor-core/esm/vs/editor/common/services/languageFeatures';
|
|
64
64
|
import * as objects from '@theia/monaco-editor-core/esm/vs/base/common/objects';
|
|
65
65
|
import { Selection } from '@theia/editor/lib/browser/editor';
|
|
66
|
+
import { IHoverService } from '@theia/monaco-editor-core/esm/vs/platform/hover/browser/hover';
|
|
66
67
|
|
|
67
68
|
export type ServicePair<T> = [ServiceIdentifier<T>, T];
|
|
68
69
|
|
|
@@ -150,7 +151,7 @@ export class MonacoEditor extends MonacoEditorServices implements TextEditor {
|
|
|
150
151
|
protected create(options?: monaco.editor.IStandaloneEditorConstructionOptions | IStandaloneEditorConstructionOptions, override?: EditorServiceOverrides): Disposable {
|
|
151
152
|
const combinedOptions = {
|
|
152
153
|
...options,
|
|
153
|
-
lightbulb: { enabled:
|
|
154
|
+
lightbulb: { enabled: ShowLightbulbIconMode.On },
|
|
154
155
|
fixedOverflowWidgets: true,
|
|
155
156
|
scrollbar: {
|
|
156
157
|
useShadows: false,
|
|
@@ -704,9 +705,21 @@ class EmbeddedCodeEditor extends StandaloneCodeEditor {
|
|
|
704
705
|
@IAccessibilityService accessibilityService: IAccessibilityService,
|
|
705
706
|
@ILanguageConfigurationService languageConfigurationService: ILanguageConfigurationService,
|
|
706
707
|
@ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService,
|
|
708
|
+
@IHoverService hoverService: IHoverService
|
|
707
709
|
) {
|
|
708
|
-
super(domElement,
|
|
709
|
-
|
|
710
|
+
super(domElement,
|
|
711
|
+
{ ...parentEditor.getRawOptions(), overflowWidgetsDomNode: parentEditor.getOverflowWidgetsDomNode() },
|
|
712
|
+
instantiationService,
|
|
713
|
+
codeEditorService,
|
|
714
|
+
commandService,
|
|
715
|
+
contextKeyService,
|
|
716
|
+
hoverService,
|
|
717
|
+
keybindingService,
|
|
718
|
+
themeService,
|
|
719
|
+
notificationService,
|
|
720
|
+
accessibilityService,
|
|
721
|
+
languageConfigurationService,
|
|
722
|
+
languageFeaturesService);
|
|
710
723
|
|
|
711
724
|
this._parentEditor = parentEditor;
|
|
712
725
|
this._overwriteOptions = options;
|
|
@@ -33,9 +33,17 @@ import { MonacoEditor } from './monaco-editor';
|
|
|
33
33
|
import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices';
|
|
34
34
|
import { StandaloneThemeService } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneThemeService';
|
|
35
35
|
import { IStandaloneThemeService } from '@theia/monaco-editor-core/esm/vs/editor/standalone/common/standaloneTheme';
|
|
36
|
+
import { SecondaryWindowService } from '@theia/core/lib/browser/window/secondary-window-service';
|
|
37
|
+
import { registerWindow } from '@theia/monaco-editor-core/esm/vs/base/browser/dom';
|
|
38
|
+
|
|
39
|
+
type CodeWindow = Window & typeof globalThis & {
|
|
40
|
+
vscodeWindowId: number;
|
|
41
|
+
};
|
|
36
42
|
|
|
37
43
|
@injectable()
|
|
38
44
|
export class MonacoFrontendApplicationContribution implements FrontendApplicationContribution, StylingParticipant {
|
|
45
|
+
protected readonly windowsById = new Map<number, monaco.IDisposable>();
|
|
46
|
+
protected nextWindowId = 2; // the main window has the id "1"
|
|
39
47
|
|
|
40
48
|
@inject(MonacoTextModelService)
|
|
41
49
|
protected readonly textModelService: MonacoTextModelService;
|
|
@@ -56,6 +64,9 @@ export class MonacoFrontendApplicationContribution implements FrontendApplicatio
|
|
|
56
64
|
@inject(SecondaryWindowHandler)
|
|
57
65
|
protected readonly secondaryWindowHandler: SecondaryWindowHandler;
|
|
58
66
|
|
|
67
|
+
@inject(SecondaryWindowService)
|
|
68
|
+
protected readonly secondaryWindowService: SecondaryWindowService;
|
|
69
|
+
|
|
59
70
|
@postConstruct()
|
|
60
71
|
protected init(): void {
|
|
61
72
|
this.addAdditionalPreferenceValidations();
|
|
@@ -98,6 +109,17 @@ export class MonacoFrontendApplicationContribution implements FrontendApplicatio
|
|
|
98
109
|
themeService.registerEditorContainer(widget.node);
|
|
99
110
|
}
|
|
100
111
|
});
|
|
112
|
+
this.secondaryWindowService.onWindowOpened(window => {
|
|
113
|
+
const codeWindow: CodeWindow = window as CodeWindow;
|
|
114
|
+
codeWindow.vscodeWindowId = this.nextWindowId++;
|
|
115
|
+
|
|
116
|
+
this.windowsById.set(codeWindow.vscodeWindowId, registerWindow(codeWindow));
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
this.secondaryWindowService.onWindowClosed(window => {
|
|
120
|
+
const codeWindow: CodeWindow = window as CodeWindow;
|
|
121
|
+
this.windowsById.get(codeWindow.vscodeWindowId)?.dispose();
|
|
122
|
+
});
|
|
101
123
|
}
|
|
102
124
|
|
|
103
125
|
registerThemeStyle(theme: ColorTheme, collector: CssStyleCollector): void {
|
|
@@ -172,8 +194,7 @@ export class MonacoFrontendApplicationContribution implements FrontendApplicatio
|
|
|
172
194
|
new editorBoolConstructor(id++, 'detectIndentation', true, editorGeneratedPreferenceProperties['editor.detectIndentation']),
|
|
173
195
|
new editorBoolConstructor(id++, 'trimAutoWhitespace', true, editorGeneratedPreferenceProperties['editor.trimAutoWhitespace']),
|
|
174
196
|
new editorBoolConstructor(id++, 'largeFileOptimizations', true, editorGeneratedPreferenceProperties['editor.largeFileOptimizations']),
|
|
175
|
-
new
|
|
176
|
-
new editorStringEnumConstructor(id++, 'wordBasedSuggestionsMode', 'matchingDocuments', editorGeneratedPreferenceProperties['editor.wordBasedSuggestionsMode'].enum, editorGeneratedPreferenceProperties['editor.wordBasedSuggestionsMode']),
|
|
197
|
+
new editorStringEnumConstructor(id++, 'wordBasedSuggestions', 'matchingDocuments', editorGeneratedPreferenceProperties['editor.wordBasedSuggestions'].enum, editorGeneratedPreferenceProperties['editor.wordBasedSuggestions']),
|
|
177
198
|
new editorBoolConstructor(id++, 'stablePeek', false, editorGeneratedPreferenceProperties['editor.stablePeek']),
|
|
178
199
|
new editorIntConstructor(id++, 'maxTokenizationLineLength', 20000, 1, MAX_SAFE_INTEGER, editorGeneratedPreferenceProperties['editor.maxTokenizationLineLength']),
|
|
179
200
|
);
|
|
@@ -66,16 +66,17 @@ import { GotoLineQuickAccessContribution } from './monaco-gotoline-quick-access'
|
|
|
66
66
|
import { GotoSymbolQuickAccessContribution } from './monaco-gotosymbol-quick-access';
|
|
67
67
|
import { QuickAccessContribution, QuickAccessRegistry } from '@theia/core/lib/browser/quick-input/quick-access';
|
|
68
68
|
import { MonacoQuickAccessRegistry } from './monaco-quick-access-registry';
|
|
69
|
-
import { ConfigurationTarget, IConfigurationChangeEvent, IConfigurationService } from '@theia/monaco-editor-core/esm/vs/platform/configuration/common/configuration';
|
|
70
|
-
import { StandaloneConfigurationService } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices';
|
|
71
|
-
import { Configuration } from '@theia/monaco-editor-core/esm/vs/platform/configuration/common/configurationModels';
|
|
69
|
+
import { ConfigurationTarget, IConfigurationChangeEvent, IConfigurationService } from '@theia/monaco-editor-core/esm/vs/platform/configuration/common/configuration.js';
|
|
70
|
+
import { StandaloneConfigurationService, StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices';
|
|
71
|
+
import { Configuration } from '@theia/monaco-editor-core/esm/vs/platform/configuration/common/configurationModels.js';
|
|
72
72
|
import { MarkdownRenderer } from '@theia/core/lib/browser/markdown-rendering/markdown-renderer';
|
|
73
73
|
import { MonacoMarkdownRenderer } from './markdown-renderer/monaco-markdown-renderer';
|
|
74
74
|
import { ThemeService } from '@theia/core/lib/browser/theming';
|
|
75
75
|
import { ThemeServiceWithDB } from './monaco-indexed-db';
|
|
76
|
-
import { IContextKeyService } from '@theia/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey';
|
|
77
|
-
import { IThemeService } from '@theia/monaco-editor-core/esm/vs/platform/theme/common/themeService';
|
|
76
|
+
import { IContextKeyService } from '@theia/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey.js';
|
|
77
|
+
import { IThemeService } from '@theia/monaco-editor-core/esm/vs/platform/theme/common/themeService.js';
|
|
78
78
|
import { ActiveMonacoUndoRedoHandler, FocusedMonacoUndoRedoHandler } from './monaco-undo-redo-handler';
|
|
79
|
+
import { ILogService } from '@theia/monaco-editor-core/esm/vs/platform/log/common/log';
|
|
79
80
|
|
|
80
81
|
export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
81
82
|
bind(MonacoThemingService).toSelf().inSingletonScope();
|
|
@@ -189,7 +190,7 @@ export const MonacoConfigurationService = Symbol('MonacoConfigurationService');
|
|
|
189
190
|
export function createMonacoConfigurationService(container: interfaces.Container): IConfigurationService {
|
|
190
191
|
const preferences = container.get<PreferenceService>(PreferenceService);
|
|
191
192
|
const preferenceSchemaProvider = container.get<PreferenceSchemaProvider>(PreferenceSchemaProvider);
|
|
192
|
-
const service = new StandaloneConfigurationService();
|
|
193
|
+
const service = new StandaloneConfigurationService(StandaloneServices.get(ILogService));
|
|
193
194
|
const _configuration: Configuration = service['_configuration'];
|
|
194
195
|
|
|
195
196
|
_configuration.getValue = (section, overrides) => {
|
|
@@ -23,26 +23,11 @@
|
|
|
23
23
|
* might call `initialize()` while being constructed.
|
|
24
24
|
* The service descriptors require a constructor function, so we declare dummy class for each Monaco service we override. But instead of returning an instance of the dummy class,
|
|
25
25
|
* we fetch the implementation of the monaco service from the inversify container.
|
|
26
|
-
* The inversify-constructed services must not call StandaloneServices.get() or StandaloneServices.initialize() from their constructors. Calling `get`()` in postConstruct
|
|
26
|
+
* The inversify-constructed services must not call StandaloneServices.get() or StandaloneServices.initialize() from their constructors. Calling `get`()` in postConstruct methods
|
|
27
27
|
* is allowed.
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
30
|
// Before importing anything from monaco we need to override its localization function
|
|
31
|
-
import * as MonacoNls from '@theia/monaco-editor-core/esm/vs/nls';
|
|
32
|
-
import { nls } from '@theia/core/lib/common/nls';
|
|
33
|
-
import { FormatType, Localization } from '@theia/core/lib/common/i18n/localization';
|
|
34
|
-
|
|
35
|
-
Object.assign(MonacoNls, {
|
|
36
|
-
localize(_key: string, label: string, ...args: FormatType[]): string {
|
|
37
|
-
if (nls.locale) {
|
|
38
|
-
const defaultKey = nls.getDefaultKey(label);
|
|
39
|
-
if (defaultKey) {
|
|
40
|
-
return nls.localize(defaultKey, label, ...args);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return Localization.format(label, args);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
31
|
|
|
47
32
|
import { Container } from '@theia/core/shared/inversify';
|
|
48
33
|
import { ICodeEditorService } from '@theia/monaco-editor-core/esm/vs/editor/browser/services/codeEditorService';
|
|
@@ -118,6 +103,12 @@ class MonacoQuickInputImplementationConstructor {
|
|
|
118
103
|
}
|
|
119
104
|
}
|
|
120
105
|
|
|
106
|
+
class MonacoStandaloneThemeServiceConstructor {
|
|
107
|
+
constructor(container: Container) {
|
|
108
|
+
return new MonacoStandaloneThemeService();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
121
112
|
export namespace MonacoInit {
|
|
122
113
|
export function init(container: Container): void {
|
|
123
114
|
StandaloneServices.initialize({
|
|
@@ -128,7 +119,7 @@ export namespace MonacoInit {
|
|
|
128
119
|
[IBulkEditService.toString()]: new SyncDescriptor(MonacoBulkEditServiceConstructor, [container]),
|
|
129
120
|
[ICommandService.toString()]: new SyncDescriptor(MonacoCommandServiceConstructor, [container]),
|
|
130
121
|
[IQuickInputService.toString()]: new SyncDescriptor(MonacoQuickInputImplementationConstructor, [container]),
|
|
131
|
-
[IStandaloneThemeService.toString()]: new
|
|
122
|
+
[IStandaloneThemeService.toString()]: new SyncDescriptor(MonacoStandaloneThemeServiceConstructor, [])
|
|
132
123
|
});
|
|
133
124
|
}
|
|
134
125
|
}
|
|
@@ -31,17 +31,18 @@ import { MonacoResolvedKeybinding } from './monaco-resolved-keybinding';
|
|
|
31
31
|
import { IQuickAccessController } from '@theia/monaco-editor-core/esm/vs/platform/quickinput/common/quickAccess';
|
|
32
32
|
import { QuickAccessController } from '@theia/monaco-editor-core/esm/vs/platform/quickinput/browser/quickAccess';
|
|
33
33
|
import { IContextKey, IContextKeyService } from '@theia/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey';
|
|
34
|
-
import { IListOptions, List } from '@theia/monaco-editor-core/esm/vs/base/browser/ui/list/listWidget';
|
|
35
34
|
import * as monaco from '@theia/monaco-editor-core';
|
|
36
35
|
import { ResolvedKeybinding } from '@theia/monaco-editor-core/esm/vs/base/common/keybindings';
|
|
37
36
|
import { IInstantiationService } from '@theia/monaco-editor-core/esm/vs/platform/instantiation/common/instantiation';
|
|
38
37
|
import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices';
|
|
39
38
|
import { IMatch } from '@theia/monaco-editor-core/esm/vs/base/common/filters';
|
|
40
|
-
import { IListRenderer, IListVirtualDelegate } from '@theia/monaco-editor-core/esm/vs/base/browser/ui/list/list';
|
|
41
39
|
import { CancellationToken, Event } from '@theia/core';
|
|
42
40
|
import { MonacoColorRegistry } from './monaco-color-registry';
|
|
43
41
|
import { ThemeService } from '@theia/core/lib/browser/theming';
|
|
44
42
|
import { IStandaloneThemeService } from '@theia/monaco-editor-core/esm/vs/editor/standalone/common/standaloneTheme';
|
|
43
|
+
import { ILayoutService } from '@theia/monaco-editor-core/esm/vs/platform/layout/browser/layoutService';
|
|
44
|
+
import { IHoverDelegate, IHoverDelegateOptions } from '@theia/monaco-editor-core/esm/vs/base/browser/ui/hover/hoverDelegate';
|
|
45
|
+
import { IHoverWidget } from '@theia/monaco-editor-core/esm/vs/base/browser/ui/hover/hover';
|
|
45
46
|
|
|
46
47
|
// Copied from @vscode/src/vs/base/parts/quickInput/browser/quickInputList.ts
|
|
47
48
|
export interface IListElement {
|
|
@@ -59,8 +60,21 @@ export interface IListElement {
|
|
|
59
60
|
readonly fireButtonTriggered: (event: IQuickPickItemButtonEvent<IQuickPickItem>) => void;
|
|
60
61
|
}
|
|
61
62
|
|
|
63
|
+
class HoverDelegate implements IHoverDelegate {
|
|
64
|
+
showHover(options: IHoverDelegateOptions, focus?: boolean | undefined): IHoverWidget | undefined {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
onDidHideHover?: (() => void) | undefined;
|
|
68
|
+
delay: number;
|
|
69
|
+
placement?: 'mouse' | 'element' | undefined;
|
|
70
|
+
showNativeHover?: boolean | undefined;
|
|
71
|
+
|
|
72
|
+
}
|
|
62
73
|
@injectable()
|
|
63
74
|
export class MonacoQuickInputImplementation implements IQuickInputService {
|
|
75
|
+
get currentQuickInput(): IQuickInput | undefined {
|
|
76
|
+
return this.controller.currentQuickInput;
|
|
77
|
+
}
|
|
64
78
|
|
|
65
79
|
declare readonly _serviceBrand: undefined;
|
|
66
80
|
|
|
@@ -77,7 +91,6 @@ export class MonacoQuickInputImplementation implements IQuickInputService {
|
|
|
77
91
|
protected readonly themeService: ThemeService;
|
|
78
92
|
|
|
79
93
|
protected container: HTMLElement;
|
|
80
|
-
private quickInputList: List<unknown>;
|
|
81
94
|
|
|
82
95
|
protected inQuickOpen: IContextKey<boolean>;
|
|
83
96
|
|
|
@@ -113,19 +126,19 @@ export class MonacoQuickInputImplementation implements IQuickInputService {
|
|
|
113
126
|
return this.controller.createQuickWidget();
|
|
114
127
|
}
|
|
115
128
|
|
|
116
|
-
createQuickPick<T extends IQuickPickItem>(): IQuickPick<T
|
|
117
|
-
|
|
129
|
+
createQuickPick<T extends IQuickPickItem>(options: { useSeparators: true; }): IQuickPick<T, { useSeparators: true; }>;
|
|
130
|
+
createQuickPick<T extends IQuickPickItem>(options: { useSeparators: false; }): IQuickPick<T, { useSeparators: false; }>;
|
|
131
|
+
createQuickPick<T extends IQuickPickItem>(options: { useSeparators: boolean }): IQuickPick<T, { useSeparators: true; }> | IQuickPick<T, { useSeparators: false; }> {
|
|
132
|
+
return this.controller.createQuickPick({
|
|
133
|
+
useSeparators: options.useSeparators
|
|
134
|
+
});
|
|
118
135
|
}
|
|
119
|
-
|
|
120
136
|
createInputBox(): IInputBox {
|
|
121
137
|
return this.controller.createInputBox();
|
|
122
138
|
}
|
|
123
139
|
|
|
124
140
|
open(filter: string): void {
|
|
125
141
|
this.quickAccess.show(filter);
|
|
126
|
-
setTimeout(() => {
|
|
127
|
-
this.quickInputList.focusNth(0);
|
|
128
|
-
}, 300);
|
|
129
142
|
}
|
|
130
143
|
|
|
131
144
|
input(options?: IInputOptions, token?: monaco.CancellationToken): Promise<string | undefined> {
|
|
@@ -185,21 +198,10 @@ export class MonacoQuickInputImplementation implements IQuickInputService {
|
|
|
185
198
|
}
|
|
186
199
|
|
|
187
200
|
private initController(): void {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
private updateLayout(): void {
|
|
193
|
-
// Initialize the layout using screen dimensions as monaco computes the actual sizing.
|
|
194
|
-
// https://github.com/microsoft/vscode/blob/6261075646f055b99068d3688932416f2346dd3b/src/vs/base/parts/quickinput/browser/quickInput.ts#L1799
|
|
195
|
-
this.controller.layout(this.getClientDimension(), 0);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
private getClientDimension(): monaco.editor.IDimension {
|
|
199
|
-
return { width: window.innerWidth, height: window.innerHeight };
|
|
200
|
-
}
|
|
201
|
+
const contextKeyService = StandaloneServices.get(IContextKeyService);
|
|
202
|
+
const instantiationService = StandaloneServices.get(IInstantiationService);
|
|
203
|
+
const layoutService = StandaloneServices.get(ILayoutService);
|
|
201
204
|
|
|
202
|
-
private getOptions(): IQuickInputOptions {
|
|
203
205
|
const options: IQuickInputOptions = {
|
|
204
206
|
idPrefix: 'quickInput_',
|
|
205
207
|
container: this.container,
|
|
@@ -208,14 +210,23 @@ export class MonacoQuickInputImplementation implements IQuickInputService {
|
|
|
208
210
|
backKeybindingLabel: () => undefined,
|
|
209
211
|
setContextKey: (id?: string) => this.setContextKey(id),
|
|
210
212
|
returnFocus: () => this.container.focus(),
|
|
211
|
-
|
|
212
|
-
user: string, container: HTMLElement, delegate: IListVirtualDelegate<T>, renderers: IListRenderer<T, unknown>[], listOptions: IListOptions<T>
|
|
213
|
-
): List<T> => this.quickInputList = new List(user, container, delegate, renderers, listOptions),
|
|
213
|
+
hoverDelegate: new HoverDelegate(),
|
|
214
214
|
linkOpenerDelegate: () => {
|
|
215
215
|
// @monaco-uplift: not sure what to do here
|
|
216
216
|
}
|
|
217
217
|
};
|
|
218
|
-
|
|
218
|
+
this.controller = new QuickInputController(options, layoutService, instantiationService, contextKeyService);
|
|
219
|
+
this.updateLayout();
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
private updateLayout(): void {
|
|
223
|
+
// Initialize the layout using screen dimensions as monaco computes the actual sizing.
|
|
224
|
+
// https://github.com/microsoft/vscode/blob/6261075646f055b99068d3688932416f2346dd3b/src/vs/base/parts/quickinput/browser/quickInput.ts#L1799
|
|
225
|
+
this.controller.layout(this.getClientDimension(), 0);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
private getClientDimension(): monaco.editor.IDimension {
|
|
229
|
+
return { width: window.innerWidth, height: window.innerHeight };
|
|
219
230
|
}
|
|
220
231
|
|
|
221
232
|
// @monaco-uplift
|
|
@@ -258,13 +269,18 @@ export class MonacoQuickInputImplementation implements IQuickInputService {
|
|
|
258
269
|
listInactiveSelectionForeground: this.colorRegistry.toCssVariableName('list.InactiveSelectionForeground'),
|
|
259
270
|
listHoverBackground: this.colorRegistry.toCssVariableName('list.HoverBackground'),
|
|
260
271
|
listHoverForeground: this.colorRegistry.toCssVariableName('list.HoverForeground'),
|
|
261
|
-
|
|
272
|
+
listDropOverBackground: this.colorRegistry.toCssVariableName('list.DropOverBackground'),
|
|
273
|
+
listDropBetweenBackground: this.colorRegistry.toCssVariableName('list.DropBetweenBackground'),
|
|
262
274
|
listSelectionOutline: this.colorRegistry.toCssVariableName('activeContrastBorder'),
|
|
263
275
|
listHoverOutline: this.colorRegistry.toCssVariableName('activeContrastBorder'),
|
|
264
276
|
treeIndentGuidesStroke: this.colorRegistry.toCssVariableName('tree.indentGuidesStroke'),
|
|
265
277
|
treeInactiveIndentGuidesStroke: this.colorRegistry.toCssVariableName('tree.inactiveIndentGuidesStroke'),
|
|
278
|
+
treeStickyScrollBackground: this.colorRegistry.toCssVariableName('tree.StickyScrollBackground'),
|
|
279
|
+
treeStickyScrollBorder: this.colorRegistry.toCssVariableName('tree.tickyScrollBorde'),
|
|
280
|
+
treeStickyScrollShadow: this.colorRegistry.toCssVariableName('tree.StickyScrollShadow'),
|
|
266
281
|
tableColumnsBorder: this.colorRegistry.toCssVariableName('tree.tableColumnsBorder'),
|
|
267
282
|
tableOddRowsBackgroundColor: this.colorRegistry.toCssVariableName('tree.tableOddRowsBackground'),
|
|
283
|
+
|
|
268
284
|
},
|
|
269
285
|
inputBox: {
|
|
270
286
|
inputForeground: this.colorRegistry.toCssVariableName('inputForeground'),
|
|
@@ -434,11 +450,11 @@ export class MonacoQuickInputService implements QuickInputService {
|
|
|
434
450
|
}
|
|
435
451
|
|
|
436
452
|
createQuickPick<T extends QuickPickItem>(): QuickPick<T> {
|
|
437
|
-
const quickPick = this.monacoService.createQuickPick<MonacoQuickPickItem<T>>();
|
|
453
|
+
const quickPick = this.monacoService.createQuickPick<MonacoQuickPickItem<T>>({ useSeparators: true });
|
|
438
454
|
return this.wrapQuickPick(quickPick);
|
|
439
455
|
}
|
|
440
456
|
|
|
441
|
-
wrapQuickPick<T extends QuickPickItem>(wrapped: IQuickPick<MonacoQuickPickItem<T
|
|
457
|
+
wrapQuickPick<T extends QuickPickItem>(wrapped: IQuickPick<MonacoQuickPickItem<T>, { useSeparators: true }>): QuickPick<T> {
|
|
442
458
|
return new MonacoQuickPick(wrapped, this.keybindingRegistry);
|
|
443
459
|
}
|
|
444
460
|
|
|
@@ -532,7 +548,7 @@ class MonacoQuickInput {
|
|
|
532
548
|
}
|
|
533
549
|
|
|
534
550
|
class MonacoQuickPick<T extends QuickPickItem> extends MonacoQuickInput implements QuickPick<T> {
|
|
535
|
-
constructor(protected override readonly wrapped: IQuickPick<MonacoQuickPickItem<T
|
|
551
|
+
constructor(protected override readonly wrapped: IQuickPick<MonacoQuickPickItem<T>, { useSeparators: true }>, protected readonly keybindingRegistry: KeybindingRegistry) {
|
|
536
552
|
super(wrapped);
|
|
537
553
|
}
|
|
538
554
|
|
|
@@ -221,14 +221,16 @@ export class MonacoWorkspace {
|
|
|
221
221
|
* Applies given edits to the given model.
|
|
222
222
|
* The model is saved if no editors is opened for it.
|
|
223
223
|
*/
|
|
224
|
-
applyBackgroundEdit(model: MonacoEditorModel, editOperations: monaco.editor.IIdentifiedSingleEditOperation[],
|
|
224
|
+
applyBackgroundEdit(model: MonacoEditorModel, editOperations: monaco.editor.IIdentifiedSingleEditOperation[],
|
|
225
|
+
shouldSave?: boolean | ((openEditor: MonacoEditor | undefined, wasDirty: boolean) => boolean)): Promise<void> {
|
|
225
226
|
return this.suppressOpenIfDirty(model, async () => {
|
|
226
227
|
const editor = MonacoEditor.findByDocument(this.editorManager, model)[0];
|
|
228
|
+
const wasDirty = !!editor?.document.dirty;
|
|
227
229
|
const cursorState = editor && editor.getControl().getSelections() || [];
|
|
228
230
|
model.textEditorModel.pushStackElement();
|
|
229
231
|
model.textEditorModel.pushEditOperations(cursorState, editOperations, () => cursorState);
|
|
230
232
|
model.textEditorModel.pushStackElement();
|
|
231
|
-
if (!editor && shouldSave) {
|
|
233
|
+
if ((typeof shouldSave === 'function' && shouldSave(editor, wasDirty)) || (!editor && shouldSave)) {
|
|
232
234
|
await model.save();
|
|
233
235
|
}
|
|
234
236
|
});
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { EditorServiceOverrides, MonacoEditor, MonacoEditorServices } from './monaco-editor';
|
|
18
18
|
|
|
19
|
-
import { CodeEditorWidget, ICodeEditorWidgetOptions } from '@theia/monaco-editor-core/esm/vs/editor/browser/widget/codeEditorWidget';
|
|
19
|
+
import { CodeEditorWidget, ICodeEditorWidgetOptions } from '@theia/monaco-editor-core/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget';
|
|
20
20
|
import { IInstantiationService } from '@theia/monaco-editor-core/esm/vs/platform/instantiation/common/instantiation';
|
|
21
21
|
import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices';
|
|
22
22
|
import { ServiceCollection } from '@theia/monaco-editor-core/esm/vs/platform/instantiation/common/serviceCollection';
|
|
@@ -27,6 +27,7 @@ import * as monaco from '@theia/monaco-editor-core';
|
|
|
27
27
|
import { ElementExt } from '@theia/core/shared/@phosphor/domutils';
|
|
28
28
|
import { Selection } from '@theia/editor/lib/browser/editor';
|
|
29
29
|
import { SelectionDirection } from '@theia/monaco-editor-core/esm/vs/editor/common/core/selection';
|
|
30
|
+
import { ShowLightbulbIconMode } from '@theia/monaco-editor-core/esm/vs/editor/common/config/editorOptions';
|
|
30
31
|
|
|
31
32
|
export class SimpleMonacoEditor extends MonacoEditorServices implements Disposable {
|
|
32
33
|
|
|
@@ -87,7 +88,7 @@ export class SimpleMonacoEditor extends MonacoEditorServices implements Disposab
|
|
|
87
88
|
protected create(options?: MonacoEditor.IOptions, override?: EditorServiceOverrides, widgetOptions?: ICodeEditorWidgetOptions): Disposable {
|
|
88
89
|
const combinedOptions = {
|
|
89
90
|
...options,
|
|
90
|
-
lightbulb: { enabled:
|
|
91
|
+
lightbulb: { enabled: ShowLightbulbIconMode.On },
|
|
91
92
|
fixedOverflowWidgets: true,
|
|
92
93
|
automaticLayout: true,
|
|
93
94
|
scrollbar: {
|