@theia/monaco 1.77.0-next.0 → 1.77.0-next.101
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/lib/browser/content-hover-widget-patcher.js +6 -9
- package/lib/browser/content-hover-widget-patcher.js.map +1 -1
- package/lib/browser/default-content-hover-widget-patcher.d.ts +1 -1
- package/lib/browser/default-content-hover-widget-patcher.d.ts.map +1 -1
- package/lib/browser/default-content-hover-widget-patcher.js +7 -10
- package/lib/browser/default-content-hover-widget-patcher.js.map +1 -1
- package/lib/browser/index.d.ts +2 -2
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +2 -5
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/markdown-renderer/monaco-markdown-renderer.d.ts +4 -4
- package/lib/browser/markdown-renderer/monaco-markdown-renderer.d.ts.map +1 -1
- package/lib/browser/markdown-renderer/monaco-markdown-renderer.js +29 -37
- package/lib/browser/markdown-renderer/monaco-markdown-renderer.js.map +1 -1
- package/lib/browser/monaco-bulk-edit-service.d.ts +4 -4
- package/lib/browser/monaco-bulk-edit-service.d.ts.map +1 -1
- package/lib/browser/monaco-bulk-edit-service.js +10 -14
- package/lib/browser/monaco-bulk-edit-service.js.map +1 -1
- package/lib/browser/monaco-code-action-save-participant.d.ts +3 -3
- package/lib/browser/monaco-code-action-save-participant.d.ts.map +1 -1
- package/lib/browser/monaco-code-action-save-participant.js +12 -16
- package/lib/browser/monaco-code-action-save-participant.js.map +1 -1
- package/lib/browser/monaco-code-action-service.d.ts +2 -2
- package/lib/browser/monaco-code-action-service.d.ts.map +1 -1
- package/lib/browser/monaco-code-action-service.js +25 -29
- package/lib/browser/monaco-code-action-service.js.map +1 -1
- package/lib/browser/monaco-color-registry.d.ts +4 -4
- package/lib/browser/monaco-color-registry.d.ts.map +1 -1
- package/lib/browser/monaco-color-registry.js +23 -26
- package/lib/browser/monaco-color-registry.js.map +1 -1
- package/lib/browser/monaco-command-registry.d.ts +2 -2
- package/lib/browser/monaco-command-registry.d.ts.map +1 -1
- package/lib/browser/monaco-command-registry.js +15 -21
- package/lib/browser/monaco-command-registry.js.map +1 -1
- package/lib/browser/monaco-command-service.d.ts +2 -2
- package/lib/browser/monaco-command-service.d.ts.map +1 -1
- package/lib/browser/monaco-command-service.js +17 -24
- package/lib/browser/monaco-command-service.js.map +1 -1
- package/lib/browser/monaco-command.d.ts +3 -3
- package/lib/browser/monaco-command.d.ts.map +1 -1
- package/lib/browser/monaco-command.js +62 -71
- package/lib/browser/monaco-command.js.map +1 -1
- package/lib/browser/monaco-context-key-service.d.ts +3 -3
- package/lib/browser/monaco-context-key-service.d.ts.map +1 -1
- package/lib/browser/monaco-context-key-service.js +17 -23
- package/lib/browser/monaco-context-key-service.js.map +1 -1
- package/lib/browser/monaco-context-menu.d.ts +5 -5
- package/lib/browser/monaco-context-menu.d.ts.map +1 -1
- package/lib/browser/monaco-context-menu.js +26 -30
- package/lib/browser/monaco-context-menu.js.map +1 -1
- package/lib/browser/monaco-diff-computer.js +10 -13
- package/lib/browser/monaco-diff-computer.js.map +1 -1
- package/lib/browser/monaco-diff-editor.d.ts +7 -7
- package/lib/browser/monaco-diff-editor.d.ts.map +1 -1
- package/lib/browser/monaco-diff-editor.js +15 -19
- package/lib/browser/monaco-diff-editor.js.map +1 -1
- package/lib/browser/monaco-diff-navigator-factory.d.ts +1 -1
- package/lib/browser/monaco-diff-navigator-factory.d.ts.map +1 -1
- package/lib/browser/monaco-diff-navigator-factory.js +5 -8
- package/lib/browser/monaco-diff-navigator-factory.js.map +1 -1
- package/lib/browser/monaco-editor-content-menu.d.ts +2 -2
- package/lib/browser/monaco-editor-content-menu.d.ts.map +1 -1
- package/lib/browser/monaco-editor-content-menu.js +36 -43
- package/lib/browser/monaco-editor-content-menu.js.map +1 -1
- package/lib/browser/monaco-editor-model.d.ts +4 -4
- package/lib/browser/monaco-editor-model.d.ts.map +1 -1
- package/lib/browser/monaco-editor-model.js +46 -50
- package/lib/browser/monaco-editor-model.js.map +1 -1
- package/lib/browser/monaco-editor-overlay-button.d.ts +1 -1
- package/lib/browser/monaco-editor-overlay-button.d.ts.map +1 -1
- package/lib/browser/monaco-editor-overlay-button.js +11 -15
- package/lib/browser/monaco-editor-overlay-button.js.map +1 -1
- package/lib/browser/monaco-editor-peek-view-widget.d.ts +2 -2
- package/lib/browser/monaco-editor-peek-view-widget.d.ts.map +1 -1
- package/lib/browser/monaco-editor-peek-view-widget.js +17 -25
- package/lib/browser/monaco-editor-peek-view-widget.js.map +1 -1
- package/lib/browser/monaco-editor-provider.d.ts +10 -10
- package/lib/browser/monaco-editor-provider.d.ts.map +1 -1
- package/lib/browser/monaco-editor-provider.js +92 -108
- package/lib/browser/monaco-editor-provider.js.map +1 -1
- package/lib/browser/monaco-editor-service.d.ts +6 -6
- package/lib/browser/monaco-editor-service.d.ts.map +1 -1
- package/lib/browser/monaco-editor-service.js +47 -59
- package/lib/browser/monaco-editor-service.js.map +1 -1
- package/lib/browser/monaco-editor-zone-widget.js +10 -14
- package/lib/browser/monaco-editor-zone-widget.js.map +1 -1
- package/lib/browser/monaco-editor.d.ts +10 -7
- package/lib/browser/monaco-editor.d.ts.map +1 -1
- package/lib/browser/monaco-editor.js +102 -94
- package/lib/browser/monaco-editor.js.map +1 -1
- package/lib/browser/monaco-editor.spec.d.ts +2 -0
- package/lib/browser/monaco-editor.spec.d.ts.map +1 -0
- package/lib/browser/monaco-editor.spec.js +202 -0
- package/lib/browser/monaco-editor.spec.js.map +1 -0
- package/lib/browser/monaco-formatter-service.d.ts +3 -3
- package/lib/browser/monaco-formatter-service.d.ts.map +1 -1
- package/lib/browser/monaco-formatter-service.js +28 -37
- package/lib/browser/monaco-formatter-service.js.map +1 -1
- package/lib/browser/monaco-formatting-conflicts.d.ts +2 -2
- package/lib/browser/monaco-formatting-conflicts.d.ts.map +1 -1
- package/lib/browser/monaco-formatting-conflicts.js +19 -25
- package/lib/browser/monaco-formatting-conflicts.js.map +1 -1
- package/lib/browser/monaco-frontend-application-contribution.d.ts +4 -4
- package/lib/browser/monaco-frontend-application-contribution.d.ts.map +1 -1
- package/lib/browser/monaco-frontend-application-contribution.js +43 -56
- package/lib/browser/monaco-frontend-application-contribution.js.map +1 -1
- package/lib/browser/monaco-frontend-module.js +163 -167
- package/lib/browser/monaco-frontend-module.js.map +1 -1
- package/lib/browser/monaco-gotoline-quick-access.d.ts +2 -2
- package/lib/browser/monaco-gotoline-quick-access.d.ts.map +1 -1
- package/lib/browser/monaco-gotoline-quick-access.js +16 -20
- package/lib/browser/monaco-gotoline-quick-access.js.map +1 -1
- package/lib/browser/monaco-gotosymbol-quick-access.d.ts +5 -5
- package/lib/browser/monaco-gotosymbol-quick-access.d.ts.map +1 -1
- package/lib/browser/monaco-gotosymbol-quick-access.js +18 -22
- package/lib/browser/monaco-gotosymbol-quick-access.js.map +1 -1
- package/lib/browser/monaco-icon-registry.d.ts +1 -1
- package/lib/browser/monaco-icon-registry.d.ts.map +1 -1
- package/lib/browser/monaco-icon-registry.js +7 -10
- package/lib/browser/monaco-icon-registry.js.map +1 -1
- package/lib/browser/monaco-indexed-db.d.ts +1 -1
- package/lib/browser/monaco-indexed-db.d.ts.map +1 -1
- package/lib/browser/monaco-indexed-db.js +28 -35
- package/lib/browser/monaco-indexed-db.js.map +1 -1
- package/lib/browser/monaco-init.d.ts +1 -1
- package/lib/browser/monaco-init.d.ts.map +1 -1
- package/lib/browser/monaco-init.js +75 -95
- package/lib/browser/monaco-init.js.map +1 -1
- package/lib/browser/monaco-init.spec.js +45 -20
- package/lib/browser/monaco-init.spec.js.map +1 -1
- package/lib/browser/monaco-keybinding.d.ts +3 -2
- package/lib/browser/monaco-keybinding.d.ts.map +1 -1
- package/lib/browser/monaco-keybinding.js +47 -51
- package/lib/browser/monaco-keybinding.js.map +1 -1
- package/lib/browser/monaco-keybinding.spec.d.ts +2 -0
- package/lib/browser/monaco-keybinding.spec.d.ts.map +1 -0
- package/lib/browser/monaco-keybinding.spec.js +94 -0
- package/lib/browser/monaco-keybinding.spec.js.map +1 -0
- package/lib/browser/monaco-keycode-map.d.ts +1 -1
- package/lib/browser/monaco-keycode-map.d.ts.map +1 -1
- package/lib/browser/monaco-keycode-map.js +122 -125
- package/lib/browser/monaco-keycode-map.js.map +1 -1
- package/lib/browser/monaco-languages.d.ts +2 -2
- package/lib/browser/monaco-languages.d.ts.map +1 -1
- package/lib/browser/monaco-languages.js +33 -41
- package/lib/browser/monaco-languages.js.map +1 -1
- package/lib/browser/monaco-marker-collection.d.ts +1 -1
- package/lib/browser/monaco-marker-collection.d.ts.map +1 -1
- package/lib/browser/monaco-marker-collection.js +2 -6
- package/lib/browser/monaco-marker-collection.js.map +1 -1
- package/lib/browser/monaco-menu.d.ts +2 -2
- package/lib/browser/monaco-menu.d.ts.map +1 -1
- package/lib/browser/monaco-menu.js +44 -48
- package/lib/browser/monaco-menu.js.map +1 -1
- package/lib/browser/monaco-mime-service.js +16 -20
- package/lib/browser/monaco-mime-service.js.map +1 -1
- package/lib/browser/monaco-nls.d.ts +1 -1
- package/lib/browser/monaco-nls.d.ts.map +1 -1
- package/lib/browser/monaco-nls.js +9 -16
- package/lib/browser/monaco-nls.js.map +1 -1
- package/lib/browser/monaco-outline-contribution.d.ts +5 -2
- package/lib/browser/monaco-outline-contribution.d.ts.map +1 -1
- package/lib/browser/monaco-outline-contribution.js +35 -36
- package/lib/browser/monaco-outline-contribution.js.map +1 -1
- package/lib/browser/monaco-outline-decorator.d.ts +1 -1
- package/lib/browser/monaco-outline-decorator.d.ts.map +1 -1
- package/lib/browser/monaco-outline-decorator.js +18 -18
- package/lib/browser/monaco-outline-decorator.js.map +1 -1
- package/lib/browser/monaco-outline-decorator.spec.d.ts +2 -0
- package/lib/browser/monaco-outline-decorator.spec.d.ts.map +1 -0
- package/lib/browser/monaco-outline-decorator.spec.js +76 -0
- package/lib/browser/monaco-outline-decorator.spec.js.map +1 -0
- package/lib/browser/monaco-quick-access-registry.js +17 -21
- package/lib/browser/monaco-quick-access-registry.js.map +1 -1
- package/lib/browser/monaco-quick-input-service.d.ts +40 -8
- package/lib/browser/monaco-quick-input-service.d.ts.map +1 -1
- package/lib/browser/monaco-quick-input-service.js +169 -74
- package/lib/browser/monaco-quick-input-service.js.map +1 -1
- package/lib/browser/monaco-quick-input-service.spec.js +9 -11
- package/lib/browser/monaco-quick-input-service.spec.js.map +1 -1
- package/lib/browser/monaco-resolved-keybinding.d.ts +1 -1
- package/lib/browser/monaco-resolved-keybinding.d.ts.map +1 -1
- package/lib/browser/monaco-resolved-keybinding.js +35 -36
- package/lib/browser/monaco-resolved-keybinding.js.map +1 -1
- package/lib/browser/monaco-snippet-suggest-provider.js +31 -37
- package/lib/browser/monaco-snippet-suggest-provider.js.map +1 -1
- package/lib/browser/monaco-standalone-theme-service.d.ts +2 -2
- package/lib/browser/monaco-standalone-theme-service.d.ts.map +1 -1
- package/lib/browser/monaco-standalone-theme-service.js +2 -6
- package/lib/browser/monaco-standalone-theme-service.js.map +1 -1
- package/lib/browser/monaco-status-bar-contribution.js +26 -29
- package/lib/browser/monaco-status-bar-contribution.js.map +1 -1
- package/lib/browser/monaco-text-model-service.d.ts +6 -6
- package/lib/browser/monaco-text-model-service.d.ts.map +1 -1
- package/lib/browser/monaco-text-model-service.js +44 -58
- package/lib/browser/monaco-text-model-service.js.map +1 -1
- package/lib/browser/monaco-theming-service.d.ts +2 -2
- package/lib/browser/monaco-theming-service.d.ts.map +1 -1
- package/lib/browser/monaco-theming-service.js +30 -37
- package/lib/browser/monaco-theming-service.js.map +1 -1
- package/lib/browser/monaco-to-protocol-converter.js +8 -11
- package/lib/browser/monaco-to-protocol-converter.js.map +1 -1
- package/lib/browser/monaco-undo-redo-handler.d.ts +2 -2
- package/lib/browser/monaco-undo-redo-handler.d.ts.map +1 -1
- package/lib/browser/monaco-undo-redo-handler.js +15 -18
- package/lib/browser/monaco-undo-redo-handler.js.map +1 -1
- package/lib/browser/monaco-utilities.d.ts +1 -1
- package/lib/browser/monaco-utilities.d.ts.map +1 -1
- package/lib/browser/monaco-utilities.js +1 -4
- package/lib/browser/monaco-utilities.js.map +1 -1
- package/lib/browser/monaco-workspace-context-service.d.ts +7 -7
- package/lib/browser/monaco-workspace-context-service.d.ts.map +1 -1
- package/lib/browser/monaco-workspace-context-service.js +12 -15
- package/lib/browser/monaco-workspace-context-service.js.map +1 -1
- package/lib/browser/monaco-workspace.d.ts +5 -5
- package/lib/browser/monaco-workspace.d.ts.map +1 -1
- package/lib/browser/monaco-workspace.js +78 -92
- package/lib/browser/monaco-workspace.js.map +1 -1
- package/lib/browser/protocol-to-monaco-converter.js +6 -9
- package/lib/browser/protocol-to-monaco-converter.js.map +1 -1
- package/lib/browser/simple-monaco-editor.d.ts +4 -4
- package/lib/browser/simple-monaco-editor.d.ts.map +1 -1
- package/lib/browser/simple-monaco-editor.js +25 -29
- package/lib/browser/simple-monaco-editor.js.map +1 -1
- package/lib/browser/textmate/index.d.ts +4 -4
- package/lib/browser/textmate/index.d.ts.map +1 -1
- package/lib/browser/textmate/index.js +4 -7
- package/lib/browser/textmate/index.js.map +1 -1
- package/lib/browser/textmate/monaco-textmate-frontend-bindings.d.ts +2 -2
- package/lib/browser/textmate/monaco-textmate-frontend-bindings.d.ts.map +1 -1
- package/lib/browser/textmate/monaco-textmate-frontend-bindings.js +33 -37
- package/lib/browser/textmate/monaco-textmate-frontend-bindings.js.map +1 -1
- package/lib/browser/textmate/monaco-textmate-service.d.ts +5 -5
- package/lib/browser/textmate/monaco-textmate-service.d.ts.map +1 -1
- package/lib/browser/textmate/monaco-textmate-service.js +52 -63
- package/lib/browser/textmate/monaco-textmate-service.js.map +1 -1
- package/lib/browser/textmate/monaco-theme-registry.d.ts +2 -2
- package/lib/browser/textmate/monaco-theme-registry.d.ts.map +1 -1
- package/lib/browser/textmate/monaco-theme-registry.js +40 -35
- package/lib/browser/textmate/monaco-theme-registry.js.map +1 -1
- package/lib/browser/textmate/monaco-theme-types.d.ts +1 -1
- package/lib/browser/textmate/monaco-theme-types.d.ts.map +1 -1
- package/lib/browser/textmate/monaco-theme-types.js +4 -7
- package/lib/browser/textmate/monaco-theme-types.js.map +1 -1
- package/lib/browser/textmate/monaco-theme-types.spec.js +12 -14
- package/lib/browser/textmate/monaco-theme-types.spec.js.map +1 -1
- package/lib/browser/textmate/textmate-contribution.d.ts +1 -1
- package/lib/browser/textmate/textmate-contribution.d.ts.map +1 -1
- package/lib/browser/textmate/textmate-contribution.js +3 -7
- package/lib/browser/textmate/textmate-contribution.js.map +1 -1
- package/lib/browser/textmate/textmate-registry.d.ts +1 -1
- package/lib/browser/textmate/textmate-registry.d.ts.map +1 -1
- package/lib/browser/textmate/textmate-registry.js +13 -17
- package/lib/browser/textmate/textmate-registry.js.map +1 -1
- package/lib/browser/textmate/textmate-snippet-completion-provider.js +4 -8
- package/lib/browser/textmate/textmate-snippet-completion-provider.js.map +1 -1
- package/lib/browser/textmate/textmate-tokenizer.d.ts +1 -1
- package/lib/browser/textmate/textmate-tokenizer.d.ts.map +1 -1
- package/lib/browser/textmate/textmate-tokenizer.js +5 -9
- package/lib/browser/textmate/textmate-tokenizer.js.map +1 -1
- package/lib/browser/textmate/textmate-tokenizer.spec.js +10 -12
- package/lib/browser/textmate/textmate-tokenizer.spec.js.map +1 -1
- package/lib/browser/workspace-symbol-command.d.ts +1 -1
- package/lib/browser/workspace-symbol-command.d.ts.map +1 -1
- package/lib/browser/workspace-symbol-command.js +35 -44
- package/lib/browser/workspace-symbol-command.js.map +1 -1
- package/lib/package.spec.d.ts +1 -0
- package/lib/package.spec.js +1 -0
- package/package.json +18 -8
- package/src/browser/content-hover-widget-patcher.ts +2 -2
- package/src/browser/default-content-hover-widget-patcher.ts +2 -2
- package/src/browser/index.ts +2 -2
- package/src/browser/markdown-renderer/monaco-markdown-renderer.ts +5 -5
- package/src/browser/monaco-bulk-edit-service.ts +4 -4
- package/src/browser/monaco-code-action-save-participant.ts +3 -3
- package/src/browser/monaco-code-action-service.ts +9 -9
- package/src/browser/monaco-color-registry.ts +5 -5
- package/src/browser/monaco-command-registry.ts +2 -2
- package/src/browser/monaco-command-service.ts +3 -3
- package/src/browser/monaco-command.ts +9 -9
- package/src/browser/monaco-context-key-service.ts +4 -4
- package/src/browser/monaco-context-menu.ts +6 -6
- package/src/browser/monaco-diff-computer.ts +2 -2
- package/src/browser/monaco-diff-editor.ts +16 -16
- package/src/browser/monaco-diff-navigator-factory.ts +1 -1
- package/src/browser/monaco-editor-content-menu.ts +5 -5
- package/src/browser/monaco-editor-model.ts +8 -8
- package/src/browser/monaco-editor-overlay-button.ts +1 -1
- package/src/browser/monaco-editor-peek-view-widget.ts +10 -10
- package/src/browser/monaco-editor-provider.ts +21 -21
- package/src/browser/monaco-editor-service.ts +9 -9
- package/src/browser/monaco-editor.spec.ts +227 -0
- package/src/browser/monaco-editor.ts +52 -32
- package/src/browser/monaco-formatter-service.ts +6 -6
- package/src/browser/monaco-formatting-conflicts.ts +5 -5
- package/src/browser/monaco-frontend-application-contribution.ts +10 -10
- package/src/browser/monaco-frontend-module.ts +46 -46
- package/src/browser/monaco-gotoline-quick-access.ts +6 -6
- package/src/browser/monaco-gotosymbol-quick-access.ts +7 -7
- package/src/browser/monaco-icon-registry.ts +1 -1
- package/src/browser/monaco-indexed-db.ts +1 -1
- package/src/browser/monaco-init.spec.ts +32 -5
- package/src/browser/monaco-init.ts +32 -32
- package/src/browser/monaco-keybinding.spec.ts +121 -0
- package/src/browser/monaco-keybinding.ts +21 -11
- package/src/browser/monaco-keycode-map.ts +2 -2
- package/src/browser/monaco-languages.ts +4 -4
- package/src/browser/monaco-marker-collection.ts +1 -1
- package/src/browser/monaco-menu.ts +3 -3
- package/src/browser/monaco-mime-service.ts +5 -5
- package/src/browser/monaco-nls.ts +1 -1
- package/src/browser/monaco-outline-contribution.ts +13 -6
- package/src/browser/monaco-outline-decorator.spec.ts +96 -0
- package/src/browser/monaco-outline-decorator.ts +9 -6
- package/src/browser/monaco-quick-access-registry.ts +5 -5
- package/src/browser/monaco-quick-input-service.spec.ts +2 -2
- package/src/browser/monaco-quick-input-service.ts +148 -25
- package/src/browser/monaco-resolved-keybinding.ts +12 -9
- package/src/browser/monaco-snippet-suggest-provider.ts +1 -1
- package/src/browser/monaco-standalone-theme-service.ts +2 -2
- package/src/browser/monaco-status-bar-contribution.ts +1 -1
- package/src/browser/monaco-text-model-service.ts +8 -8
- package/src/browser/monaco-theming-service.ts +2 -2
- package/src/browser/monaco-undo-redo-handler.ts +3 -3
- package/src/browser/monaco-utilities.ts +1 -1
- package/src/browser/monaco-workspace-context-service.ts +3 -3
- package/src/browser/monaco-workspace.ts +10 -10
- package/src/browser/simple-monaco-editor.ts +8 -8
- package/src/browser/style/index.css +1 -5
- package/src/browser/textmate/index.ts +4 -4
- package/src/browser/textmate/monaco-textmate-frontend-bindings.ts +17 -15
- package/src/browser/textmate/monaco-textmate-service.ts +11 -11
- package/src/browser/textmate/monaco-theme-registry.ts +25 -15
- package/src/browser/textmate/monaco-theme-types.spec.ts +1 -1
- package/src/browser/textmate/monaco-theme-types.ts +1 -1
- package/src/browser/textmate/textmate-contribution.ts +1 -1
- package/src/browser/textmate/textmate-registry.ts +1 -1
- package/src/browser/textmate/textmate-snippet-completion-provider.ts +1 -1
- package/src/browser/textmate/textmate-tokenizer.spec.ts +1 -1
- package/src/browser/textmate/textmate-tokenizer.ts +3 -2
- package/src/browser/workspace-symbol-command.ts +1 -1
- package/src/typings/wasm.d.ts +21 -0
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { Diagnostic } from '@theia/core/shared/vscode-languageserver-protocol';
|
|
18
|
-
import { ProtocolToMonacoConverter } from './protocol-to-monaco-converter';
|
|
18
|
+
import { ProtocolToMonacoConverter } from './protocol-to-monaco-converter.js';
|
|
19
19
|
import * as monaco from '@theia/monaco-editor-core';
|
|
20
20
|
import { Marker } from '@theia/markers/lib/common/marker';
|
|
21
21
|
import URI from '@theia/core/lib/common/uri';
|
|
@@ -18,9 +18,9 @@ import { MAIN_MENU_BAR, MenuAction, MenuContribution, MenuModelRegistry, MenuPat
|
|
|
18
18
|
import { nls } from '@theia/core/lib/common/nls';
|
|
19
19
|
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
20
20
|
import { EDITOR_CONTEXT_MENU, EditorMainMenu } from '@theia/editor/lib/browser';
|
|
21
|
-
import { IMenuItem, MenuId, MenuRegistry, isIMenuItem } from '@theia/monaco-editor-core/esm/vs/platform/actions/common/actions';
|
|
22
|
-
import { MonacoCommands } from './monaco-command';
|
|
23
|
-
import { MonacoCommandRegistry } from './monaco-command-registry';
|
|
21
|
+
import { IMenuItem, MenuId, MenuRegistry, isIMenuItem } from '@theia/monaco-editor-core/esm/vs/platform/actions/common/actions.js';
|
|
22
|
+
import { MonacoCommands } from './monaco-command.js';
|
|
23
|
+
import { MonacoCommandRegistry } from './monaco-command-registry.js';
|
|
24
24
|
|
|
25
25
|
export interface MonacoActionGroup {
|
|
26
26
|
id: string;
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import debounce
|
|
17
|
+
import debounce from '@theia/core/shared/lodash.debounce';
|
|
18
18
|
import { injectable } from '@theia/core/shared/inversify';
|
|
19
19
|
import { MimeAssociation, MimeService } from '@theia/core/lib/browser/mime-service';
|
|
20
|
-
import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices';
|
|
21
|
-
import { ILanguageService } from '@theia/monaco-editor-core/esm/vs/editor/common/languages/language';
|
|
20
|
+
import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices.js';
|
|
21
|
+
import { ILanguageService } from '@theia/monaco-editor-core/esm/vs/editor/common/languages/language.js';
|
|
22
22
|
import * as monaco from '@theia/monaco-editor-core';
|
|
23
|
-
import { clearConfiguredLanguageAssociations, registerConfiguredLanguageAssociation } from '@theia/monaco-editor-core/esm/vs/editor/common/services/languagesAssociations';
|
|
24
|
-
import { LanguageService } from '@theia/monaco-editor-core/esm/vs/editor/common/services/languageService';
|
|
23
|
+
import { clearConfiguredLanguageAssociations, registerConfiguredLanguageAssociation } from '@theia/monaco-editor-core/esm/vs/editor/common/services/languagesAssociations.js';
|
|
24
|
+
import { LanguageService } from '@theia/monaco-editor-core/esm/vs/editor/common/services/languageService.js';
|
|
25
25
|
|
|
26
26
|
@injectable()
|
|
27
27
|
export class MonacoMimeService extends MimeService {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
27
|
// Re-export the message store — imported via a path that is NOT aliased.
|
|
28
|
-
export { getNLSLanguage, getNLSMessages } from '@theia/monaco-editor-core/esm/vs/nls.messages';
|
|
28
|
+
export { getNLSLanguage, getNLSMessages } from '@theia/monaco-editor-core/esm/vs/nls.messages.js';
|
|
29
29
|
|
|
30
30
|
import { nls } from '@theia/core/lib/common/nls';
|
|
31
31
|
import { FormatType, Localization } from '@theia/core/lib/common/i18n/localization';
|
|
@@ -21,13 +21,13 @@ import { DisposableCollection, Disposable } from '@theia/core';
|
|
|
21
21
|
import { OutlineViewService } from '@theia/outline-view/lib/browser/outline-view-service';
|
|
22
22
|
import { OutlineSymbolInformationNode } from '@theia/outline-view/lib/browser/outline-view-widget';
|
|
23
23
|
import URI from '@theia/core/lib/common/uri';
|
|
24
|
-
import { MonacoEditor } from './monaco-editor';
|
|
25
|
-
import debounce
|
|
24
|
+
import { MonacoEditor } from './monaco-editor.js';
|
|
25
|
+
import debounce from '@theia/core/shared/lodash.debounce';
|
|
26
26
|
import * as monaco from '@theia/monaco-editor-core';
|
|
27
|
-
import { ILanguageFeaturesService } from '@theia/monaco-editor-core/esm/vs/editor/common/services/languageFeatures';
|
|
28
|
-
import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices';
|
|
29
|
-
import { ITextModel } from '@theia/monaco-editor-core/esm/vs/editor/common/model';
|
|
30
|
-
import { DocumentSymbol } from '@theia/monaco-editor-core/esm/vs/editor/common/languages';
|
|
27
|
+
import { ILanguageFeaturesService } from '@theia/monaco-editor-core/esm/vs/editor/common/services/languageFeatures.js';
|
|
28
|
+
import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices.js';
|
|
29
|
+
import { ITextModel } from '@theia/monaco-editor-core/esm/vs/editor/common/model.js';
|
|
30
|
+
import { DocumentSymbol } from '@theia/monaco-editor-core/esm/vs/editor/common/languages.js';
|
|
31
31
|
|
|
32
32
|
@injectable()
|
|
33
33
|
export class MonacoOutlineContribution implements FrontendApplicationContribution {
|
|
@@ -301,6 +301,7 @@ export class MonacoOutlineContribution implements FrontendApplicationContributio
|
|
|
301
301
|
iconClass: monaco.languages.SymbolKind[symbol.kind].toString().toLowerCase(),
|
|
302
302
|
name: this.getName(symbol),
|
|
303
303
|
detail: this.getDetail(symbol),
|
|
304
|
+
deprecated: this.isDeprecated(symbol),
|
|
304
305
|
parent,
|
|
305
306
|
uri,
|
|
306
307
|
range: this.getNameRange(symbol),
|
|
@@ -324,6 +325,10 @@ export class MonacoOutlineContribution implements FrontendApplicationContributio
|
|
|
324
325
|
return symbol.detail;
|
|
325
326
|
}
|
|
326
327
|
|
|
328
|
+
protected isDeprecated(symbol: monaco.languages.DocumentSymbol): boolean {
|
|
329
|
+
return !!symbol.tags?.includes(monaco.languages.SymbolTag.Deprecated);
|
|
330
|
+
}
|
|
331
|
+
|
|
327
332
|
protected createId(name: string, ids: Map<string, number>): string {
|
|
328
333
|
const counter = ids.get(name);
|
|
329
334
|
const index = typeof counter === 'number' ? counter + 1 : 0;
|
|
@@ -370,6 +375,8 @@ export interface MonacoOutlineSymbolInformationNode extends OutlineSymbolInforma
|
|
|
370
375
|
range: Range;
|
|
371
376
|
fullRange: Range;
|
|
372
377
|
detail?: string;
|
|
378
|
+
/** Whether the symbol is tagged as deprecated. */
|
|
379
|
+
deprecated?: boolean;
|
|
373
380
|
parent: MonacoOutlineSymbolInformationNode | undefined;
|
|
374
381
|
children: MonacoOutlineSymbolInformationNode[];
|
|
375
382
|
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2026 Vinay Kaushal 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 { enableJSDOM } from '@theia/core/lib/browser/test/jsdom';
|
|
18
|
+
import { expect } from 'chai';
|
|
19
|
+
import URI from '@theia/core/lib/common/uri';
|
|
20
|
+
import type { CompositeTreeNode, Tree } from '@theia/core/lib/browser/tree';
|
|
21
|
+
import type { TreeDecoration } from '@theia/core/lib/browser/tree/tree-decorator';
|
|
22
|
+
import type * as monaco from '@theia/monaco-editor-core';
|
|
23
|
+
import type { MonacoOutlineSymbolInformationNode } from './monaco-outline-contribution.js';
|
|
24
|
+
|
|
25
|
+
describe('MonacoOutlineDecorator', () => {
|
|
26
|
+
|
|
27
|
+
// The outline code uses the full monaco API at runtime. Load it only once this suite runs: loading it while
|
|
28
|
+
// the spec files are collected registers monaco's editor contributions before monaco-init.spec initializes
|
|
29
|
+
// the standalone services, which then need browser APIs that JSDOM does not provide.
|
|
30
|
+
let monacoApi: typeof monaco;
|
|
31
|
+
let outline: typeof import('./monaco-outline-contribution.js');
|
|
32
|
+
let decorator: typeof import('./monaco-outline-decorator.js');
|
|
33
|
+
let disableJSDOM: () => void;
|
|
34
|
+
|
|
35
|
+
before(async () => {
|
|
36
|
+
disableJSDOM = enableJSDOM();
|
|
37
|
+
// @lumino/dragdrop (pulled in transitively) extends the DragEvent DOM global at
|
|
38
|
+
// module load, which JSDOM does not provide; stub it so the import succeeds.
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
+
if (!(global as any).DragEvent) {
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
42
|
+
(global as any).DragEvent = class DragEvent extends (global as any).Event { };
|
|
43
|
+
}
|
|
44
|
+
monacoApi = await import('@theia/monaco-editor-core');
|
|
45
|
+
outline = await import('./monaco-outline-contribution.js');
|
|
46
|
+
decorator = await import('./monaco-outline-decorator.js');
|
|
47
|
+
});
|
|
48
|
+
after(() => disableJSDOM());
|
|
49
|
+
|
|
50
|
+
const range: monaco.IRange = { startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 10 };
|
|
51
|
+
|
|
52
|
+
function symbol(name: string, detail: string, deprecated = false): monaco.languages.DocumentSymbol {
|
|
53
|
+
const tags = deprecated ? [monacoApi.languages.SymbolTag.Deprecated] : [];
|
|
54
|
+
return { name, detail, kind: monacoApi.languages.SymbolKind.Method, tags, range, selectionRange: range };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function createNode(documentSymbol: monaco.languages.DocumentSymbol): MonacoOutlineSymbolInformationNode {
|
|
58
|
+
return new outline.MonacoOutlineContribution()['createNode'](new URI('file:///test.ts'), documentSymbol, new Map());
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function decorate(...nodes: MonacoOutlineSymbolInformationNode[]): Promise<Map<string, TreeDecoration.Data>> {
|
|
62
|
+
const root: CompositeTreeNode = { id: 'root', name: 'root', parent: undefined, children: nodes };
|
|
63
|
+
return new decorator.MonacoOutlineDecorator().decorations({ root } as unknown as Tree);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
it('marks a symbol tagged as deprecated', () => {
|
|
67
|
+
expect(createNode(symbol('old', '', true)).deprecated).to.equal(true);
|
|
68
|
+
expect(createNode(symbol('current', '')).deprecated).to.equal(false);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('strikes through a deprecated symbol', async () => {
|
|
72
|
+
const node = createNode(symbol('old', '', true));
|
|
73
|
+
|
|
74
|
+
const decorations = await decorate(node);
|
|
75
|
+
|
|
76
|
+
expect(decorations.get(node.id)?.fontData).to.deep.equal({ style: 'line-through' });
|
|
77
|
+
expect(decorations.get(node.id)?.captionSuffixes).to.equal(undefined);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('keeps the detail suffix of a deprecated symbol', async () => {
|
|
81
|
+
const node = createNode(symbol('old', '(): void', true));
|
|
82
|
+
|
|
83
|
+
const decorations = await decorate(node);
|
|
84
|
+
|
|
85
|
+
expect(decorations.get(node.id)?.fontData).to.deep.equal({ style: 'line-through' });
|
|
86
|
+
expect(decorations.get(node.id)?.captionSuffixes?.map(suffix => suffix.data)).to.deep.equal(['(): void']);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
it('does not decorate a symbol that is neither deprecated nor has a detail', async () => {
|
|
90
|
+
const node = createNode(symbol('current', ''));
|
|
91
|
+
|
|
92
|
+
const decorations = await decorate(node);
|
|
93
|
+
|
|
94
|
+
expect(decorations.has(node.id)).to.equal(false);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
@@ -19,7 +19,7 @@ import { Event, Emitter } from '@theia/core/lib/common/event';
|
|
|
19
19
|
import { Tree } from '@theia/core/lib/browser/tree/tree';
|
|
20
20
|
import { DepthFirstTreeIterator } from '@theia/core/lib/browser/tree/tree-iterator';
|
|
21
21
|
import { TreeDecorator, TreeDecoration } from '@theia/core/lib/browser/tree/tree-decorator';
|
|
22
|
-
import { MonacoOutlineSymbolInformationNode } from './monaco-outline-contribution';
|
|
22
|
+
import { MonacoOutlineSymbolInformationNode } from './monaco-outline-contribution.js';
|
|
23
23
|
|
|
24
24
|
@injectable()
|
|
25
25
|
export class MonacoOutlineDecorator implements TreeDecorator {
|
|
@@ -43,7 +43,7 @@ export class MonacoOutlineDecorator implements TreeDecorator {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
for (const treeNode of new DepthFirstTreeIterator(tree.root)) {
|
|
46
|
-
if (MonacoOutlineSymbolInformationNode.is(treeNode) && treeNode.detail) {
|
|
46
|
+
if (MonacoOutlineSymbolInformationNode.is(treeNode) && (treeNode.detail || treeNode.deprecated)) {
|
|
47
47
|
result.set(treeNode.id, this.toDecoration(treeNode));
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -52,15 +52,18 @@ export class MonacoOutlineDecorator implements TreeDecorator {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
protected toDecoration(node: MonacoOutlineSymbolInformationNode): TreeDecoration.Data {
|
|
55
|
-
const captionSuffixes: TreeDecoration.CaptionAffix[] = [{
|
|
56
|
-
data:
|
|
55
|
+
const captionSuffixes: TreeDecoration.CaptionAffix[] | undefined = node.detail ? [{
|
|
56
|
+
data: node.detail,
|
|
57
57
|
fontData: {
|
|
58
58
|
color: 'var(--theia-descriptionForeground)',
|
|
59
59
|
}
|
|
60
|
-
}];
|
|
60
|
+
}] : undefined;
|
|
61
|
+
// Like VS Code, strike through the names of deprecated symbols.
|
|
62
|
+
const fontData: TreeDecoration.FontData | undefined = node.deprecated ? { style: 'line-through' } : undefined;
|
|
61
63
|
|
|
62
64
|
return {
|
|
63
|
-
captionSuffixes
|
|
65
|
+
captionSuffixes,
|
|
66
|
+
fontData
|
|
64
67
|
};
|
|
65
68
|
}
|
|
66
69
|
}
|
|
@@ -18,10 +18,10 @@ import { KeybindingRegistry, QuickPickItem, QuickPickSeparator } from '@theia/co
|
|
|
18
18
|
import { QuickAccessProviderDescriptor, QuickAccessRegistry } from '@theia/core/lib/browser/quick-input/quick-access';
|
|
19
19
|
import { CancellationToken, Disposable } from '@theia/core/lib/common';
|
|
20
20
|
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
21
|
-
import { MonacoQuickPickItem } from './monaco-quick-input-service';
|
|
21
|
+
import { MonacoQuickPickItem } from './monaco-quick-input-service.js';
|
|
22
22
|
import {
|
|
23
23
|
IPickerQuickAccessProviderOptions, PickerQuickAccessProvider, Picks, Pick, IPickerQuickAccessItem
|
|
24
|
-
} from '@theia/monaco-editor-core/esm/vs/platform/quickinput/browser/pickerQuickAccess';
|
|
24
|
+
} from '@theia/monaco-editor-core/esm/vs/platform/quickinput/browser/pickerQuickAccess.js';
|
|
25
25
|
import {
|
|
26
26
|
Extensions,
|
|
27
27
|
IQuickAccessProvider,
|
|
@@ -29,9 +29,9 @@ import {
|
|
|
29
29
|
IQuickAccessProviderHelp,
|
|
30
30
|
IQuickAccessRegistry,
|
|
31
31
|
QuickAccessRegistry as VSCodeQuickAccessRegistry,
|
|
32
|
-
} from '@theia/monaco-editor-core/esm/vs/platform/quickinput/common/quickAccess';
|
|
33
|
-
import { IQuickPickItem, IQuickPickItemWithResource } from '@theia/monaco-editor-core/esm/vs/platform/quickinput/common/quickInput';
|
|
34
|
-
import { Registry } from '@theia/monaco-editor-core/esm/vs/platform/registry/common/platform';
|
|
32
|
+
} from '@theia/monaco-editor-core/esm/vs/platform/quickinput/common/quickAccess.js';
|
|
33
|
+
import { IQuickPickItem, IQuickPickItemWithResource } from '@theia/monaco-editor-core/esm/vs/platform/quickinput/common/quickInput.js';
|
|
34
|
+
import { Registry } from '@theia/monaco-editor-core/esm/vs/platform/registry/common/platform.js';
|
|
35
35
|
|
|
36
36
|
interface IAnythingQuickPickItem extends IPickerQuickAccessItem, IQuickPickItemWithResource { }
|
|
37
37
|
|
|
@@ -26,8 +26,8 @@ if (!(global as any).DragEvent) {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
import { expect } from 'chai';
|
|
29
|
-
import { getColorRegistry } from '@theia/monaco-editor-core/esm/vs/platform/theme/common/colorRegistry';
|
|
30
|
-
import { MonacoQuickInputImplementation } from './monaco-quick-input-service';
|
|
29
|
+
import { getColorRegistry } from '@theia/monaco-editor-core/esm/vs/platform/theme/common/colorRegistry.js';
|
|
30
|
+
import { MonacoQuickInputImplementation } from './monaco-quick-input-service.js';
|
|
31
31
|
|
|
32
32
|
disableJSDOM();
|
|
33
33
|
|
|
@@ -25,29 +25,36 @@ import {
|
|
|
25
25
|
IInputBox, IInputOptions, IKeyMods, IPickOptions, IQuickInput, IQuickInputButton,
|
|
26
26
|
IQuickInputService, IQuickNavigateConfiguration, IQuickPick, IQuickPickItem, IQuickPickItemButtonEvent,
|
|
27
27
|
IQuickPickSeparator, IQuickTree, IQuickTreeItem, IQuickWidget, QuickPickInput
|
|
28
|
-
} from '@theia/monaco-editor-core/esm/vs/platform/quickinput/common/quickInput';
|
|
29
|
-
import { IQuickInputOptions, IQuickInputStyles } from '@theia/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInput';
|
|
30
|
-
import { QuickInputController } from '@theia/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInputController';
|
|
31
|
-
import { MonacoResolvedKeybinding } from './monaco-resolved-keybinding';
|
|
32
|
-
import { IQuickAccessController } from '@theia/monaco-editor-core/esm/vs/platform/quickinput/common/quickAccess';
|
|
33
|
-
import { QuickAccessController } from '@theia/monaco-editor-core/esm/vs/platform/quickinput/browser/quickAccess';
|
|
34
|
-
import { IContextKey, IContextKeyService, IScopedContextKeyService } from '@theia/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey';
|
|
28
|
+
} from '@theia/monaco-editor-core/esm/vs/platform/quickinput/common/quickInput.js';
|
|
29
|
+
import { IQuickInputOptions, IQuickInputStyles } from '@theia/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInput.js';
|
|
30
|
+
import { QuickInputController } from '@theia/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInputController.js';
|
|
31
|
+
import { MonacoResolvedKeybinding } from './monaco-resolved-keybinding.js';
|
|
32
|
+
import { IQuickAccessController } from '@theia/monaco-editor-core/esm/vs/platform/quickinput/common/quickAccess.js';
|
|
33
|
+
import { QuickAccessController } from '@theia/monaco-editor-core/esm/vs/platform/quickinput/browser/quickAccess.js';
|
|
34
|
+
import { IContextKey, IContextKeyService, IScopedContextKeyService } from '@theia/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey.js';
|
|
35
35
|
import * as monaco from '@theia/monaco-editor-core';
|
|
36
|
-
import { ResolvedKeybinding } from '@theia/monaco-editor-core/esm/vs/base/common/keybindings';
|
|
37
|
-
import { IInstantiationService } from '@theia/monaco-editor-core/esm/vs/platform/instantiation/common/instantiation';
|
|
38
|
-
import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices';
|
|
39
|
-
import { IMatch } from '@theia/monaco-editor-core/esm/vs/base/common/filters';
|
|
36
|
+
import { ResolvedKeybinding } from '@theia/monaco-editor-core/esm/vs/base/common/keybindings.js';
|
|
37
|
+
import { IInstantiationService } from '@theia/monaco-editor-core/esm/vs/platform/instantiation/common/instantiation.js';
|
|
38
|
+
import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices.js';
|
|
39
|
+
import { IMatch } from '@theia/monaco-editor-core/esm/vs/base/common/filters.js';
|
|
40
40
|
import { CancellationToken, Event } from '@theia/core';
|
|
41
|
-
import { MonacoColorRegistry } from './monaco-color-registry';
|
|
41
|
+
import { MonacoColorRegistry } from './monaco-color-registry.js';
|
|
42
42
|
import { ThemeService } from '@theia/core/lib/browser/theming';
|
|
43
|
-
import { IStandaloneThemeService } from '@theia/monaco-editor-core/esm/vs/editor/standalone/common/standaloneTheme';
|
|
44
|
-
import { ILayoutService } from '@theia/monaco-editor-core/esm/vs/platform/layout/browser/layoutService';
|
|
45
|
-
import { IHoverDelegate, IHoverDelegateOptions } from '@theia/monaco-editor-core/esm/vs/base/browser/ui/hover/hoverDelegate';
|
|
46
|
-
import { IHoverWidget } from '@theia/monaco-editor-core/esm/vs/base/browser/ui/hover/hover';
|
|
47
|
-
import
|
|
43
|
+
import { IStandaloneThemeService } from '@theia/monaco-editor-core/esm/vs/editor/standalone/common/standaloneTheme.js';
|
|
44
|
+
import { ILayoutService } from '@theia/monaco-editor-core/esm/vs/platform/layout/browser/layoutService.js';
|
|
45
|
+
import { IHoverDelegate, IHoverDelegateOptions } from '@theia/monaco-editor-core/esm/vs/base/browser/ui/hover/hoverDelegate.js';
|
|
46
|
+
import { IHoverWidget } from '@theia/monaco-editor-core/esm/vs/base/browser/ui/hover/hover.js';
|
|
47
|
+
import MonacoSeverityModule from '@theia/monaco-editor-core/esm/vs/base/common/severity.js';
|
|
48
48
|
import { Severity } from '@theia/core/lib/common/severity';
|
|
49
|
-
import { IStorageService } from '@theia/monaco-editor-core/esm/vs/platform/storage/common/storage';
|
|
50
|
-
import { IContextMenuService } from '@theia/monaco-editor-core/esm/vs/platform/contextview/browser/contextView';
|
|
49
|
+
import { IStorageService } from '@theia/monaco-editor-core/esm/vs/platform/storage/common/storage.js';
|
|
50
|
+
import { IContextMenuService } from '@theia/monaco-editor-core/esm/vs/platform/contextview/browser/contextView.js';
|
|
51
|
+
import { WindowFocusService } from '@theia/core/lib/browser/window/window-focus-service';
|
|
52
|
+
import { SecondaryWindowService } from '@theia/core/lib/browser/window/secondary-window-service';
|
|
53
|
+
|
|
54
|
+
// `@theia/monaco-editor-core` ships ES modules without declaring `"type": "module"`, so the compiler assumes CommonJS semantics
|
|
55
|
+
// for their default exports. At runtime, the default export is the `Severity` enum.
|
|
56
|
+
const MonacoSeverity = MonacoSeverityModule as unknown as typeof MonacoSeverityModule.default;
|
|
57
|
+
type MonacoSeverity = MonacoSeverityModule.default;
|
|
51
58
|
|
|
52
59
|
/**
|
|
53
60
|
* Converts Theia's {@link Severity} to Monaco's {@link MonacoSeverity}.
|
|
@@ -112,8 +119,31 @@ export class MonacoQuickInputImplementation implements IQuickInputService {
|
|
|
112
119
|
@inject(ThemeService)
|
|
113
120
|
protected readonly themeService: ThemeService;
|
|
114
121
|
|
|
122
|
+
@inject(WindowFocusService)
|
|
123
|
+
protected readonly windowFocusService: WindowFocusService;
|
|
124
|
+
|
|
125
|
+
@inject(SecondaryWindowService)
|
|
126
|
+
protected readonly secondaryWindowService: SecondaryWindowService;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The container hosting the quick input in the main window.
|
|
130
|
+
*/
|
|
115
131
|
protected container: HTMLElement;
|
|
116
132
|
|
|
133
|
+
/**
|
|
134
|
+
* The containers hosting the quick input in secondary windows, see {@link getContainer}.
|
|
135
|
+
*/
|
|
136
|
+
protected readonly secondaryContainers = new Map<Window, {
|
|
137
|
+
container: HTMLElement,
|
|
138
|
+
scopedContextKeyService: IScopedContextKeyService,
|
|
139
|
+
scopedInQuickOpen: IContextKey<boolean>
|
|
140
|
+
}>();
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* The element that had focus when the quick input was shown. Cleared when the quick input is hidden.
|
|
144
|
+
*/
|
|
145
|
+
previousFocusElement: HTMLElement | undefined;
|
|
146
|
+
|
|
117
147
|
protected inQuickOpen: IContextKey<boolean>;
|
|
118
148
|
|
|
119
149
|
/**
|
|
@@ -144,19 +174,111 @@ export class MonacoQuickInputImplementation implements IQuickInputService {
|
|
|
144
174
|
this.scopedInQuickOpen = this.scopedContextKeyService.createKey<boolean>('inQuickOpen', false);
|
|
145
175
|
|
|
146
176
|
this.controller.onShow(() => {
|
|
147
|
-
|
|
177
|
+
// The controller has moved the quick input to the container of the focused window, see `createLayoutService`.
|
|
178
|
+
const container = this.controller.container;
|
|
179
|
+
// `onShow` fires before focus moves into the quick input, and again whenever it switches to another picker.
|
|
180
|
+
const activeElement = container.ownerDocument.activeElement;
|
|
181
|
+
// not using `instanceof HTMLElement`, the element may have been created in a secondary window, i.e. in another JavaScript realm
|
|
182
|
+
if (activeElement && typeof (activeElement as HTMLElement).focus === 'function' && !container.contains(activeElement)) {
|
|
183
|
+
this.previousFocusElement = activeElement as HTMLElement;
|
|
184
|
+
}
|
|
185
|
+
container.style.top = container === this.container ? this.shell.mainPanel.node.getBoundingClientRect().top + 'px' : '0px';
|
|
148
186
|
this.inQuickOpen.set(true);
|
|
149
|
-
this.
|
|
187
|
+
this.getScopedInQuickOpen(container).set(true);
|
|
150
188
|
});
|
|
151
189
|
this.controller.onHide(() => {
|
|
190
|
+
this.previousFocusElement = undefined;
|
|
152
191
|
this.inQuickOpen.set(false);
|
|
153
192
|
this.scopedInQuickOpen.set(false);
|
|
193
|
+
this.secondaryContainers.forEach(({ scopedInQuickOpen }) => scopedInQuickOpen.set(false));
|
|
154
194
|
});
|
|
155
195
|
|
|
156
196
|
this.themeService.initialized.then(() => this.controller.applyStyles(this.computeStyles()));
|
|
157
197
|
// Hook into the theming service of Monaco to ensure that the updates are ready.
|
|
158
198
|
StandaloneServices.get(IStandaloneThemeService).onDidColorThemeChange(() => this.controller.applyStyles(this.computeStyles()));
|
|
159
199
|
window.addEventListener('resize', () => this.updateLayout());
|
|
200
|
+
this.secondaryWindowService.onWindowClosed(win => {
|
|
201
|
+
const secondary = this.secondaryContainers.get(win);
|
|
202
|
+
if (!secondary) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
if (this.controller.container === secondary.container) {
|
|
206
|
+
// Move the quick input back to the main window, as Monaco does on `onWillUnregisterWindow` for the windows registered with it.
|
|
207
|
+
this.controller['reparentUI'](this.container);
|
|
208
|
+
this.updateLayout();
|
|
209
|
+
}
|
|
210
|
+
secondary.scopedContextKeyService.dispose();
|
|
211
|
+
this.secondaryContainers.delete(win);
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* @returns the container hosting the quick input in the given window, which is created for secondary windows if necessary
|
|
217
|
+
*/
|
|
218
|
+
protected getContainer(win: Window): HTMLElement {
|
|
219
|
+
if (win === window) {
|
|
220
|
+
return this.container;
|
|
221
|
+
}
|
|
222
|
+
let secondary = this.secondaryContainers.get(win);
|
|
223
|
+
if (!secondary) {
|
|
224
|
+
const container = win.document.createElement('div');
|
|
225
|
+
container.id = 'quick-input-container';
|
|
226
|
+
win.document.body.appendChild(container);
|
|
227
|
+
const scopedContextKeyService = StandaloneServices.get(IContextKeyService).createScoped(container);
|
|
228
|
+
secondary = { container, scopedContextKeyService, scopedInQuickOpen: scopedContextKeyService.createKey<boolean>('inQuickOpen', false) };
|
|
229
|
+
this.secondaryContainers.set(win, secondary);
|
|
230
|
+
win.addEventListener('resize', () => this.updateLayout());
|
|
231
|
+
}
|
|
232
|
+
return secondary.container;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
protected getScopedInQuickOpen(container: HTMLElement): IContextKey<boolean> {
|
|
236
|
+
for (const secondary of this.secondaryContainers.values()) {
|
|
237
|
+
if (secondary.container === container) {
|
|
238
|
+
return secondary.scopedInQuickOpen;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return this.scopedInQuickOpen;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Creates the layout service of the quick input controller. The controller moves the quick input to the `activeContainer`
|
|
246
|
+
* of the layout service whenever it is shown, which is the container of the focused window, so that the quick input
|
|
247
|
+
* is shown in secondary windows as well.
|
|
248
|
+
*/
|
|
249
|
+
protected createLayoutService(delegate: ILayoutService): ILayoutService {
|
|
250
|
+
const getActiveContainer = () => this.getContainer(this.windowFocusService.focusedWindow ?? window);
|
|
251
|
+
const getDimension = (container: HTMLElement) => this.getClientDimension(container.ownerDocument.defaultView ?? window);
|
|
252
|
+
const getMainContainer = () => this.container;
|
|
253
|
+
const getContainers = () => [this.container, ...Array.from(this.secondaryContainers.values(), secondary => secondary.container)];
|
|
254
|
+
return {
|
|
255
|
+
_serviceBrand: undefined,
|
|
256
|
+
onDidLayoutMainContainer: delegate.onDidLayoutMainContainer,
|
|
257
|
+
onDidLayoutContainer: delegate.onDidLayoutContainer,
|
|
258
|
+
onDidLayoutActiveContainer: delegate.onDidLayoutActiveContainer,
|
|
259
|
+
onDidAddContainer: delegate.onDidAddContainer,
|
|
260
|
+
onDidChangeActiveContainer: delegate.onDidChangeActiveContainer,
|
|
261
|
+
get mainContainer(): HTMLElement {
|
|
262
|
+
return getMainContainer();
|
|
263
|
+
},
|
|
264
|
+
get mainContainerDimension(): monaco.editor.IDimension {
|
|
265
|
+
return getDimension(getMainContainer());
|
|
266
|
+
},
|
|
267
|
+
get activeContainer(): HTMLElement {
|
|
268
|
+
return getActiveContainer();
|
|
269
|
+
},
|
|
270
|
+
get activeContainerDimension(): monaco.editor.IDimension {
|
|
271
|
+
return getDimension(getActiveContainer());
|
|
272
|
+
},
|
|
273
|
+
get containers(): Iterable<HTMLElement> {
|
|
274
|
+
return getContainers();
|
|
275
|
+
},
|
|
276
|
+
getContainer: win => this.getContainer(win),
|
|
277
|
+
whenContainerStylesLoaded: win => delegate.whenContainerStylesLoaded(win),
|
|
278
|
+
mainContainerOffset: delegate.mainContainerOffset,
|
|
279
|
+
activeContainerOffset: delegate.activeContainerOffset,
|
|
280
|
+
focus: () => delegate.focus()
|
|
281
|
+
};
|
|
160
282
|
}
|
|
161
283
|
|
|
162
284
|
setContextKey(key: string | undefined): void {
|
|
@@ -257,7 +379,7 @@ export class MonacoQuickInputImplementation implements IQuickInputService {
|
|
|
257
379
|
private initController(): void {
|
|
258
380
|
const contextKeyService = StandaloneServices.get(IContextKeyService);
|
|
259
381
|
const instantiationService = StandaloneServices.get(IInstantiationService);
|
|
260
|
-
const layoutService = StandaloneServices.get(ILayoutService);
|
|
382
|
+
const layoutService = this.createLayoutService(StandaloneServices.get(ILayoutService));
|
|
261
383
|
const storageService = StandaloneServices.get(IStorageService);
|
|
262
384
|
|
|
263
385
|
const options: IQuickInputOptions = {
|
|
@@ -281,11 +403,11 @@ export class MonacoQuickInputImplementation implements IQuickInputService {
|
|
|
281
403
|
private updateLayout(): void {
|
|
282
404
|
// Initialize the layout using screen dimensions as monaco computes the actual sizing.
|
|
283
405
|
// https://github.com/microsoft/vscode/blob/6261075646f055b99068d3688932416f2346dd3b/src/vs/base/parts/quickinput/browser/quickInput.ts#L1799
|
|
284
|
-
this.controller.layout(this.getClientDimension(), 0);
|
|
406
|
+
this.controller.layout(this.getClientDimension(this.controller.container.ownerDocument.defaultView ?? window), 0);
|
|
285
407
|
}
|
|
286
408
|
|
|
287
|
-
private getClientDimension(): monaco.editor.IDimension {
|
|
288
|
-
return { width:
|
|
409
|
+
private getClientDimension(win: Window): monaco.editor.IDimension {
|
|
410
|
+
return { width: win.innerWidth, height: win.innerHeight };
|
|
289
411
|
}
|
|
290
412
|
|
|
291
413
|
/**
|
|
@@ -407,6 +529,7 @@ export class MonacoQuickInputService implements QuickInputService {
|
|
|
407
529
|
|
|
408
530
|
get onShow(): Event<void> { return this.monacoService.onShow; }
|
|
409
531
|
get onHide(): Event<void> { return this.monacoService.onHide; }
|
|
532
|
+
get previousFocusElement(): HTMLElement | undefined { return this.monacoService.previousFocusElement; }
|
|
410
533
|
|
|
411
534
|
open(filter: string): void {
|
|
412
535
|
this.monacoService.open(filter);
|
|
@@ -14,17 +14,18 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { KeyCode as MonacoKeyCode } from '@theia/monaco-editor-core/esm/vs/base/common/keyCodes';
|
|
17
|
+
import { KeyCode as MonacoKeyCode } from '@theia/monaco-editor-core/esm/vs/base/common/keyCodes.js';
|
|
18
18
|
import {
|
|
19
19
|
ResolvedKeybinding, ResolvedChord, SingleModifierChord, KeyCodeChord, Chord
|
|
20
|
-
} from '@theia/monaco-editor-core/esm/vs/base/common/keybindings';
|
|
21
|
-
import { ElectronAcceleratorLabelProvider, UILabelProvider, UserSettingsLabelProvider } from '@theia/monaco-editor-core/esm/vs/base/common/keybindingLabels';
|
|
22
|
-
import { USLayoutResolvedKeybinding } from '@theia/monaco-editor-core/esm/vs/platform/keybinding/common/usLayoutResolvedKeybinding';
|
|
23
|
-
import * as MonacoPlatform from '@theia/monaco-editor-core/esm/vs/base/common/platform';
|
|
20
|
+
} from '@theia/monaco-editor-core/esm/vs/base/common/keybindings.js';
|
|
21
|
+
import { ElectronAcceleratorLabelProvider, UILabelProvider, UserSettingsLabelProvider } from '@theia/monaco-editor-core/esm/vs/base/common/keybindingLabels.js';
|
|
22
|
+
import { USLayoutResolvedKeybinding } from '@theia/monaco-editor-core/esm/vs/platform/keybinding/common/usLayoutResolvedKeybinding.js';
|
|
23
|
+
import * as MonacoPlatform from '@theia/monaco-editor-core/esm/vs/base/common/platform.js';
|
|
24
24
|
import { KeybindingRegistry } from '@theia/core/lib/browser/keybinding';
|
|
25
25
|
import { KeyCode, KeySequence, Keystroke, Key, KeyModifier } from '@theia/core/lib/browser/keys';
|
|
26
|
+
import { layoutModifiersIncludeShift } from '@theia/core/lib/common/keys';
|
|
26
27
|
import { isOSX } from '@theia/core/lib/common/os';
|
|
27
|
-
import { KEY_CODE_MAP } from './monaco-keycode-map';
|
|
28
|
+
import { KEY_CODE_MAP } from './monaco-keycode-map.js';
|
|
28
29
|
|
|
29
30
|
export class MonacoResolvedKeybinding extends ResolvedKeybinding {
|
|
30
31
|
|
|
@@ -33,12 +34,14 @@ export class MonacoResolvedKeybinding extends ResolvedKeybinding {
|
|
|
33
34
|
constructor(protected readonly keySequence: KeySequence, keybindingService: KeybindingRegistry) {
|
|
34
35
|
super();
|
|
35
36
|
this.chords = keySequence.map(keyCode => {
|
|
37
|
+
const components = keybindingService.componentsForKeyCode(keyCode);
|
|
36
38
|
// eslint-disable-next-line no-null/no-null
|
|
37
|
-
const keyLabel = keyCode.key ?
|
|
39
|
+
const keyLabel = keyCode.key ? components[components.length - 1] : null;
|
|
38
40
|
const keyAriaLabel = keyLabel;
|
|
41
|
+
// The label uses the logical character, so layout Shift only appears when it produced an uppercase letter.
|
|
39
42
|
return new ResolvedChord(
|
|
40
43
|
keyCode.ctrl,
|
|
41
|
-
keyCode
|
|
44
|
+
keybindingService.displaysShift(keyCode),
|
|
42
45
|
keyCode.alt,
|
|
43
46
|
keyCode.meta,
|
|
44
47
|
keyLabel,
|
|
@@ -106,7 +109,7 @@ export class MonacoResolvedKeybinding extends ResolvedKeybinding {
|
|
|
106
109
|
private toKeybinding(keyCode: KeyCode): KeyCodeChord {
|
|
107
110
|
return new KeyCodeChord(
|
|
108
111
|
keyCode.ctrl,
|
|
109
|
-
keyCode.shift,
|
|
112
|
+
keyCode.shift || layoutModifiersIncludeShift(keyCode.layoutModifiers),
|
|
110
113
|
keyCode.alt,
|
|
111
114
|
keyCode.meta,
|
|
112
115
|
KEY_CODE_MAP[keyCode.key!.keyCode]
|
|
@@ -25,7 +25,7 @@ import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposa
|
|
|
25
25
|
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
26
26
|
import { FileOperationError } from '@theia/filesystem/lib/common/files';
|
|
27
27
|
import * as monaco from '@theia/monaco-editor-core';
|
|
28
|
-
import { SnippetParser } from '@theia/monaco-editor-core/esm/vs/editor/contrib/snippet/browser/snippetParser';
|
|
28
|
+
import { SnippetParser } from '@theia/monaco-editor-core/esm/vs/editor/contrib/snippet/browser/snippetParser.js';
|
|
29
29
|
import { isObject } from '@theia/core/lib/common';
|
|
30
30
|
import { ILogger } from '@theia/core';
|
|
31
31
|
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
16
|
// *****************************************************************************
|
|
17
17
|
|
|
18
|
-
import { IDisposable } from '@theia/monaco-editor-core/esm/vs/base/common/lifecycle';
|
|
19
|
-
import { StandaloneThemeService } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneThemeService';
|
|
18
|
+
import { IDisposable } from '@theia/monaco-editor-core/esm/vs/base/common/lifecycle.js';
|
|
19
|
+
import { StandaloneThemeService } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneThemeService.js';
|
|
20
20
|
|
|
21
21
|
export class MonacoStandaloneThemeService extends StandaloneThemeService {
|
|
22
22
|
protected get styleElements(): HTMLStyleElement[] {
|
|
@@ -18,7 +18,7 @@ import { injectable } from '@theia/core/shared/inversify';
|
|
|
18
18
|
import { DisposableCollection, nls } from '@theia/core';
|
|
19
19
|
import { StatusBar, StatusBarAlignment, Widget, WidgetStatusBarContribution } from '@theia/core/lib/browser';
|
|
20
20
|
import { EditorCommands, EditorWidget } from '@theia/editor/lib/browser';
|
|
21
|
-
import { MonacoEditor } from './monaco-editor';
|
|
21
|
+
import { MonacoEditor } from './monaco-editor.js';
|
|
22
22
|
import * as monaco from '@theia/monaco-editor-core';
|
|
23
23
|
|
|
24
24
|
export const EDITOR_STATUS_TABBING_CONFIG = 'editor-status-tabbing-config';
|
|
@@ -18,17 +18,17 @@ import { inject, injectable, named, postConstruct } from '@theia/core/shared/inv
|
|
|
18
18
|
import URI from '@theia/core/lib/common/uri';
|
|
19
19
|
import { ResourceProvider, ReferenceCollection, Event, MaybePromise, Resource, ContributionProvider, OS, Emitter } from '@theia/core';
|
|
20
20
|
import { EditorPreferences, EditorPreferenceChange } from '@theia/editor/lib/common/editor-preferences';
|
|
21
|
-
import { MonacoEditorModel } from './monaco-editor-model';
|
|
22
|
-
import { IDisposable, IReference } from '@theia/monaco-editor-core/esm/vs/base/common/lifecycle';
|
|
23
|
-
import { MonacoToProtocolConverter } from './monaco-to-protocol-converter';
|
|
24
|
-
import { ProtocolToMonacoConverter } from './protocol-to-monaco-converter';
|
|
21
|
+
import { MonacoEditorModel } from './monaco-editor-model.js';
|
|
22
|
+
import { IDisposable, IReference } from '@theia/monaco-editor-core/esm/vs/base/common/lifecycle.js';
|
|
23
|
+
import { MonacoToProtocolConverter } from './monaco-to-protocol-converter.js';
|
|
24
|
+
import { ProtocolToMonacoConverter } from './protocol-to-monaco-converter.js';
|
|
25
25
|
import { ILogger } from '@theia/core/lib/common/logger';
|
|
26
26
|
import * as monaco from '@theia/monaco-editor-core';
|
|
27
|
-
import { ITextModelService, ITextModelContentProvider } from '@theia/monaco-editor-core/esm/vs/editor/common/services/resolverService';
|
|
28
|
-
import { ITextModelUpdateOptions } from '@theia/monaco-editor-core/esm/vs/editor/common/model';
|
|
27
|
+
import { ITextModelService, ITextModelContentProvider } from '@theia/monaco-editor-core/esm/vs/editor/common/services/resolverService.js';
|
|
28
|
+
import { ITextModelUpdateOptions } from '@theia/monaco-editor-core/esm/vs/editor/common/model.js';
|
|
29
29
|
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
30
|
-
import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices';
|
|
31
|
-
import { ITextResourcePropertiesService } from '@theia/monaco-editor-core/esm/vs/editor/common/services/textResourceConfiguration';
|
|
30
|
+
import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices.js';
|
|
31
|
+
import { ITextResourcePropertiesService } from '@theia/monaco-editor-core/esm/vs/editor/common/services/textResourceConfiguration.js';
|
|
32
32
|
|
|
33
33
|
export const MonacoEditorModelFactory = Symbol('MonacoEditorModelFactory');
|
|
34
34
|
export interface MonacoEditorModelFactory {
|