@theia/monaco 1.53.0-next.55 → 1.53.0-next.64

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.
Files changed (77) hide show
  1. package/README.md +100 -100
  2. package/data/monaco-nls.json +1379 -1379
  3. package/data/monaco-themes/vscode/dark_plus.json +201 -201
  4. package/data/monaco-themes/vscode/dark_theia.json +5 -5
  5. package/data/monaco-themes/vscode/dark_vs.json +393 -393
  6. package/data/monaco-themes/vscode/hc_black.json +457 -457
  7. package/data/monaco-themes/vscode/hc_light.json +590 -590
  8. package/data/monaco-themes/vscode/hc_theia.json +5 -5
  9. package/data/monaco-themes/vscode/hc_theia_light.json +5 -5
  10. package/data/monaco-themes/vscode/light_plus.json +202 -202
  11. package/data/monaco-themes/vscode/light_theia.json +10 -10
  12. package/data/monaco-themes/vscode/light_vs.json +421 -421
  13. package/lib/browser/monaco-editor-zone-widget.js +1 -1
  14. package/lib/browser/monaco-frontend-application-contribution.js +25 -25
  15. package/lib/browser/simple-monaco-editor.d.ts +3 -1
  16. package/lib/browser/simple-monaco-editor.d.ts.map +1 -1
  17. package/lib/browser/simple-monaco-editor.js +9 -2
  18. package/lib/browser/simple-monaco-editor.js.map +1 -1
  19. package/package.json +8 -8
  20. package/src/browser/index.ts +17 -17
  21. package/src/browser/markdown-renderer/monaco-markdown-renderer.ts +109 -109
  22. package/src/browser/monaco-bulk-edit-service.ts +64 -64
  23. package/src/browser/monaco-color-registry.ts +73 -73
  24. package/src/browser/monaco-command-registry.ts +85 -85
  25. package/src/browser/monaco-command-service.ts +90 -90
  26. package/src/browser/monaco-command.ts +303 -303
  27. package/src/browser/monaco-context-key-service.ts +144 -144
  28. package/src/browser/monaco-context-menu.ts +112 -112
  29. package/src/browser/monaco-diff-editor.ts +141 -141
  30. package/src/browser/monaco-diff-navigator-factory.ts +39 -39
  31. package/src/browser/monaco-editor-model.ts +693 -693
  32. package/src/browser/monaco-editor-peek-view-widget.ts +233 -233
  33. package/src/browser/monaco-editor-provider.ts +455 -455
  34. package/src/browser/monaco-editor-service.ts +152 -152
  35. package/src/browser/monaco-editor-zone-widget.ts +250 -250
  36. package/src/browser/monaco-editor.ts +733 -733
  37. package/src/browser/monaco-formatting-conflicts.ts +116 -116
  38. package/src/browser/monaco-frontend-application-contribution.ts +182 -182
  39. package/src/browser/monaco-frontend-module.ts +319 -319
  40. package/src/browser/monaco-gotoline-quick-access.ts +47 -47
  41. package/src/browser/monaco-gotosymbol-quick-access.ts +53 -53
  42. package/src/browser/monaco-icon-registry.ts +49 -49
  43. package/src/browser/monaco-indexed-db.ts +130 -130
  44. package/src/browser/monaco-init.ts +134 -134
  45. package/src/browser/monaco-keybinding.ts +111 -111
  46. package/src/browser/monaco-keycode-map.ts +171 -171
  47. package/src/browser/monaco-languages.ts +177 -177
  48. package/src/browser/monaco-marker-collection.ts +83 -83
  49. package/src/browser/monaco-menu.ts +147 -147
  50. package/src/browser/monaco-mime-service.ts +71 -71
  51. package/src/browser/monaco-outline-contribution.ts +404 -404
  52. package/src/browser/monaco-outline-decorator.ts +66 -66
  53. package/src/browser/monaco-quick-access-registry.ts +112 -112
  54. package/src/browser/monaco-quick-input-service.ts +701 -701
  55. package/src/browser/monaco-resolved-keybinding.ts +162 -162
  56. package/src/browser/monaco-snippet-suggest-provider.ts +306 -306
  57. package/src/browser/monaco-standalone-theme-service.ts +51 -51
  58. package/src/browser/monaco-status-bar-contribution.ts +110 -110
  59. package/src/browser/monaco-text-model-service.ts +157 -157
  60. package/src/browser/monaco-theming-service.ts +204 -204
  61. package/src/browser/monaco-to-protocol-converter.ts +82 -82
  62. package/src/browser/monaco-undo-redo-handler.ts +64 -64
  63. package/src/browser/monaco-workspace.ts +416 -416
  64. package/src/browser/protocol-to-monaco-converter.ts +158 -158
  65. package/src/browser/simple-monaco-editor.ts +228 -216
  66. package/src/browser/style/index.css +266 -266
  67. package/src/browser/textmate/index.ts +20 -20
  68. package/src/browser/textmate/monaco-textmate-frontend-bindings.ts +90 -90
  69. package/src/browser/textmate/monaco-textmate-service.ts +187 -187
  70. package/src/browser/textmate/monaco-theme-registry.ts +176 -176
  71. package/src/browser/textmate/monaco-theme-types.ts +37 -37
  72. package/src/browser/textmate/textmate-contribution.ts +29 -29
  73. package/src/browser/textmate/textmate-registry.ts +129 -129
  74. package/src/browser/textmate/textmate-snippet-completion-provider.ts +73 -73
  75. package/src/browser/textmate/textmate-tokenizer.ts +84 -84
  76. package/src/browser/workspace-symbol-command.ts +196 -196
  77. package/src/package.spec.ts +28 -28
@@ -1,141 +1,141 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2018 TypeFox and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import URI from '@theia/core/lib/common/uri';
18
- import { Disposable } from '@theia/core/lib/common';
19
- import { Dimension, DiffNavigator, DeltaDecorationParams } from '@theia/editor/lib/browser';
20
- import { MonacoEditorModel } from './monaco-editor-model';
21
- import { EditorServiceOverrides, MonacoEditor, MonacoEditorServices } from './monaco-editor';
22
- import { MonacoDiffNavigatorFactory } from './monaco-diff-navigator-factory';
23
- import { DiffUris } from '@theia/core/lib/browser/diff-uris';
24
- import * as monaco from '@theia/monaco-editor-core';
25
- import { ICodeEditor, IDiffEditorConstructionOptions } from '@theia/monaco-editor-core/esm/vs/editor/browser/editorBrowser';
26
- import { IActionDescriptor, IStandaloneCodeEditor, IStandaloneDiffEditor, StandaloneCodeEditor, StandaloneDiffEditor2 }
27
- from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneCodeEditor';
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/embeddedCodeEditorWidget';
30
- import { IInstantiationService } from '@theia/monaco-editor-core/esm/vs/platform/instantiation/common/instantiation';
31
- import { ContextKeyValue, IContextKey } from '@theia/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey';
32
- import { IDisposable } from '@theia/monaco-editor-core/esm/vs/base/common/lifecycle';
33
- import { ICommandHandler } from '@theia/monaco-editor-core/esm/vs/platform/commands/common/commands';
34
-
35
- export namespace MonacoDiffEditor {
36
- export interface IOptions extends MonacoEditor.ICommonOptions, IDiffEditorConstructionOptions {
37
- }
38
- }
39
-
40
- export class MonacoDiffEditor extends MonacoEditor {
41
- protected _diffEditor: IStandaloneDiffEditor;
42
- protected _diffNavigator: DiffNavigator;
43
-
44
- constructor(
45
- uri: URI,
46
- node: HTMLElement,
47
- readonly originalModel: MonacoEditorModel,
48
- readonly modifiedModel: MonacoEditorModel,
49
- services: MonacoEditorServices,
50
- protected readonly diffNavigatorFactory: MonacoDiffNavigatorFactory,
51
- options?: MonacoDiffEditor.IOptions,
52
- override?: EditorServiceOverrides,
53
- parentEditor?: MonacoEditor
54
- ) {
55
- super(uri, modifiedModel, node, services, options, override, parentEditor);
56
- this.documents.add(originalModel);
57
- const original = originalModel.textEditorModel;
58
- const modified = modifiedModel.textEditorModel;
59
- this._diffNavigator = diffNavigatorFactory.createdDiffNavigator(this._diffEditor);
60
- this._diffEditor.setModel({ original, modified });
61
- }
62
-
63
- get diffEditor(): monaco.editor.IStandaloneDiffEditor {
64
- return this._diffEditor as unknown as monaco.editor.IStandaloneDiffEditor;
65
- }
66
-
67
- get diffNavigator(): DiffNavigator {
68
- return this._diffNavigator;
69
- }
70
-
71
- protected override create(options?: IDiffEditorConstructionOptions, override?: EditorServiceOverrides): Disposable {
72
- options = { ...options, fixedOverflowWidgets: true };
73
- const instantiator = this.getInstantiatorWithOverrides(override);
74
- /**
75
- * @monaco-uplift. Should be guaranteed to work.
76
- * Incomparable enums prevent TypeScript from believing that public IStandaloneDiffEditor is satisfied by private StandaloneDiffEditor
77
- */
78
- this._diffEditor = this.parentEditor ?
79
- instantiator.createInstance(EmbeddedDiffEditor, this.node, options, {}, this.parentEditor.getControl() as unknown as ICodeEditor) :
80
- instantiator.createInstance(StandaloneDiffEditor2, this.node, options);
81
- this.editor = this._diffEditor.getModifiedEditor() as unknown as monaco.editor.IStandaloneCodeEditor;
82
- return this._diffEditor;
83
- }
84
-
85
- protected override resize(dimension: Dimension | null): void {
86
- if (this.node) {
87
- const layoutSize = this.computeLayoutSize(this.node, dimension);
88
- this._diffEditor.layout(layoutSize);
89
- }
90
- }
91
-
92
- override isActionSupported(id: string): boolean {
93
- const action = this._diffEditor.getSupportedActions().find(a => a.id === id);
94
- return !!action && action.isSupported() && super.isActionSupported(id);
95
- }
96
-
97
- override deltaDecorations(params: DeltaDecorationParams): string[] {
98
- console.warn('`deltaDecorations` should be called on either the original, or the modified editor.');
99
- return [];
100
- }
101
-
102
- override getResourceUri(): URI {
103
- return new URI(this.originalModel.uri);
104
- }
105
- override createMoveToUri(resourceUri: URI): URI {
106
- const [left, right] = DiffUris.decode(this.uri);
107
- return DiffUris.encode(left.withPath(resourceUri.path), right.withPath(resourceUri.path));
108
- }
109
-
110
- override shouldDisplayDirtyDiff(): boolean {
111
- return false;
112
- }
113
- }
114
-
115
- class EmbeddedDiffEditor extends EmbeddedDiffEditorWidget implements IStandaloneDiffEditor {
116
-
117
- protected override _createInnerEditor(instantiationService: IInstantiationService, container: HTMLElement,
118
- options: Readonly<IEditorConstructionOptions>): StandaloneCodeEditor {
119
- return instantiationService.createInstance(StandaloneCodeEditor, container, options);
120
- }
121
-
122
- override getOriginalEditor(): IStandaloneCodeEditor {
123
- return super.getOriginalEditor() as IStandaloneCodeEditor;
124
- }
125
-
126
- override getModifiedEditor(): IStandaloneCodeEditor {
127
- return super.getModifiedEditor() as IStandaloneCodeEditor;
128
- }
129
-
130
- addCommand(keybinding: number, handler: ICommandHandler, context?: string): string | null {
131
- return this.getModifiedEditor().addCommand(keybinding, handler, context);
132
- }
133
-
134
- createContextKey<T extends ContextKeyValue = ContextKeyValue>(key: string, defaultValue: T): IContextKey<T> {
135
- return this.getModifiedEditor().createContextKey(key, defaultValue);
136
- }
137
-
138
- addAction(descriptor: IActionDescriptor): IDisposable {
139
- return this.getModifiedEditor().addAction(descriptor);
140
- }
141
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2018 TypeFox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import URI from '@theia/core/lib/common/uri';
18
+ import { Disposable } from '@theia/core/lib/common';
19
+ import { Dimension, DiffNavigator, DeltaDecorationParams } from '@theia/editor/lib/browser';
20
+ import { MonacoEditorModel } from './monaco-editor-model';
21
+ import { EditorServiceOverrides, MonacoEditor, MonacoEditorServices } from './monaco-editor';
22
+ import { MonacoDiffNavigatorFactory } from './monaco-diff-navigator-factory';
23
+ import { DiffUris } from '@theia/core/lib/browser/diff-uris';
24
+ import * as monaco from '@theia/monaco-editor-core';
25
+ import { ICodeEditor, IDiffEditorConstructionOptions } from '@theia/monaco-editor-core/esm/vs/editor/browser/editorBrowser';
26
+ import { IActionDescriptor, IStandaloneCodeEditor, IStandaloneDiffEditor, StandaloneCodeEditor, StandaloneDiffEditor2 }
27
+ from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneCodeEditor';
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/embeddedCodeEditorWidget';
30
+ import { IInstantiationService } from '@theia/monaco-editor-core/esm/vs/platform/instantiation/common/instantiation';
31
+ import { ContextKeyValue, IContextKey } from '@theia/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey';
32
+ import { IDisposable } from '@theia/monaco-editor-core/esm/vs/base/common/lifecycle';
33
+ import { ICommandHandler } from '@theia/monaco-editor-core/esm/vs/platform/commands/common/commands';
34
+
35
+ export namespace MonacoDiffEditor {
36
+ export interface IOptions extends MonacoEditor.ICommonOptions, IDiffEditorConstructionOptions {
37
+ }
38
+ }
39
+
40
+ export class MonacoDiffEditor extends MonacoEditor {
41
+ protected _diffEditor: IStandaloneDiffEditor;
42
+ protected _diffNavigator: DiffNavigator;
43
+
44
+ constructor(
45
+ uri: URI,
46
+ node: HTMLElement,
47
+ readonly originalModel: MonacoEditorModel,
48
+ readonly modifiedModel: MonacoEditorModel,
49
+ services: MonacoEditorServices,
50
+ protected readonly diffNavigatorFactory: MonacoDiffNavigatorFactory,
51
+ options?: MonacoDiffEditor.IOptions,
52
+ override?: EditorServiceOverrides,
53
+ parentEditor?: MonacoEditor
54
+ ) {
55
+ super(uri, modifiedModel, node, services, options, override, parentEditor);
56
+ this.documents.add(originalModel);
57
+ const original = originalModel.textEditorModel;
58
+ const modified = modifiedModel.textEditorModel;
59
+ this._diffNavigator = diffNavigatorFactory.createdDiffNavigator(this._diffEditor);
60
+ this._diffEditor.setModel({ original, modified });
61
+ }
62
+
63
+ get diffEditor(): monaco.editor.IStandaloneDiffEditor {
64
+ return this._diffEditor as unknown as monaco.editor.IStandaloneDiffEditor;
65
+ }
66
+
67
+ get diffNavigator(): DiffNavigator {
68
+ return this._diffNavigator;
69
+ }
70
+
71
+ protected override create(options?: IDiffEditorConstructionOptions, override?: EditorServiceOverrides): Disposable {
72
+ options = { ...options, fixedOverflowWidgets: true };
73
+ const instantiator = this.getInstantiatorWithOverrides(override);
74
+ /**
75
+ * @monaco-uplift. Should be guaranteed to work.
76
+ * Incomparable enums prevent TypeScript from believing that public IStandaloneDiffEditor is satisfied by private StandaloneDiffEditor
77
+ */
78
+ this._diffEditor = this.parentEditor ?
79
+ instantiator.createInstance(EmbeddedDiffEditor, this.node, options, {}, this.parentEditor.getControl() as unknown as ICodeEditor) :
80
+ instantiator.createInstance(StandaloneDiffEditor2, this.node, options);
81
+ this.editor = this._diffEditor.getModifiedEditor() as unknown as monaco.editor.IStandaloneCodeEditor;
82
+ return this._diffEditor;
83
+ }
84
+
85
+ protected override resize(dimension: Dimension | null): void {
86
+ if (this.node) {
87
+ const layoutSize = this.computeLayoutSize(this.node, dimension);
88
+ this._diffEditor.layout(layoutSize);
89
+ }
90
+ }
91
+
92
+ override isActionSupported(id: string): boolean {
93
+ const action = this._diffEditor.getSupportedActions().find(a => a.id === id);
94
+ return !!action && action.isSupported() && super.isActionSupported(id);
95
+ }
96
+
97
+ override deltaDecorations(params: DeltaDecorationParams): string[] {
98
+ console.warn('`deltaDecorations` should be called on either the original, or the modified editor.');
99
+ return [];
100
+ }
101
+
102
+ override getResourceUri(): URI {
103
+ return new URI(this.originalModel.uri);
104
+ }
105
+ override createMoveToUri(resourceUri: URI): URI {
106
+ const [left, right] = DiffUris.decode(this.uri);
107
+ return DiffUris.encode(left.withPath(resourceUri.path), right.withPath(resourceUri.path));
108
+ }
109
+
110
+ override shouldDisplayDirtyDiff(): boolean {
111
+ return false;
112
+ }
113
+ }
114
+
115
+ class EmbeddedDiffEditor extends EmbeddedDiffEditorWidget implements IStandaloneDiffEditor {
116
+
117
+ protected override _createInnerEditor(instantiationService: IInstantiationService, container: HTMLElement,
118
+ options: Readonly<IEditorConstructionOptions>): StandaloneCodeEditor {
119
+ return instantiationService.createInstance(StandaloneCodeEditor, container, options);
120
+ }
121
+
122
+ override getOriginalEditor(): IStandaloneCodeEditor {
123
+ return super.getOriginalEditor() as IStandaloneCodeEditor;
124
+ }
125
+
126
+ override getModifiedEditor(): IStandaloneCodeEditor {
127
+ return super.getModifiedEditor() as IStandaloneCodeEditor;
128
+ }
129
+
130
+ addCommand(keybinding: number, handler: ICommandHandler, context?: string): string | null {
131
+ return this.getModifiedEditor().addCommand(keybinding, handler, context);
132
+ }
133
+
134
+ createContextKey<T extends ContextKeyValue = ContextKeyValue>(key: string, defaultValue: T): IContextKey<T> {
135
+ return this.getModifiedEditor().createContextKey(key, defaultValue);
136
+ }
137
+
138
+ addAction(descriptor: IActionDescriptor): IDisposable {
139
+ return this.getModifiedEditor().addAction(descriptor);
140
+ }
141
+ }
@@ -1,39 +1,39 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2018 TypeFox and others.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { injectable } from '@theia/core/shared/inversify';
18
- import { DiffNavigator } from '@theia/editor/lib/browser';
19
- import { IDiffEditor } from '@theia/monaco-editor-core/esm/vs/editor/browser/editorBrowser';
20
-
21
- @injectable()
22
- export class MonacoDiffNavigatorFactory {
23
-
24
- static nullNavigator = <DiffNavigator>{
25
- hasNext: () => false,
26
- hasPrevious: () => false,
27
- next: () => { },
28
- previous: () => { },
29
- };
30
-
31
- createdDiffNavigator(editor: IDiffEditor): DiffNavigator {
32
- return {
33
- hasNext: () => true,
34
- hasPrevious: () => true,
35
- next: () => editor.goToDiff('next'),
36
- previous: () => editor.goToDiff('previous')
37
- };
38
- }
39
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2018 TypeFox and others.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { injectable } from '@theia/core/shared/inversify';
18
+ import { DiffNavigator } from '@theia/editor/lib/browser';
19
+ import { IDiffEditor } from '@theia/monaco-editor-core/esm/vs/editor/browser/editorBrowser';
20
+
21
+ @injectable()
22
+ export class MonacoDiffNavigatorFactory {
23
+
24
+ static nullNavigator = <DiffNavigator>{
25
+ hasNext: () => false,
26
+ hasPrevious: () => false,
27
+ next: () => { },
28
+ previous: () => { },
29
+ };
30
+
31
+ createdDiffNavigator(editor: IDiffEditor): DiffNavigator {
32
+ return {
33
+ hasNext: () => true,
34
+ hasPrevious: () => true,
35
+ next: () => editor.goToDiff('next'),
36
+ previous: () => editor.goToDiff('previous')
37
+ };
38
+ }
39
+ }