@theia/core 1.75.0-next.8 → 1.75.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -24
- package/i18n/nls.cs.json +334 -98
- package/i18n/nls.de.json +335 -99
- package/i18n/nls.es.json +337 -101
- package/i18n/nls.fr.json +335 -99
- package/i18n/nls.hu.json +337 -101
- package/i18n/nls.it.json +334 -98
- package/i18n/nls.ja.json +335 -99
- package/i18n/nls.json +338 -102
- package/i18n/nls.ko.json +335 -99
- package/i18n/nls.pl.json +335 -99
- package/i18n/nls.pt-br.json +338 -102
- package/i18n/nls.ru.json +338 -102
- package/i18n/nls.tr.json +337 -101
- package/i18n/nls.zh-cn.json +337 -101
- package/i18n/nls.zh-tw.json +337 -101
- package/lib/browser/about-dialog.js +6 -35
- package/lib/browser/about-dialog.js.map +1 -1
- package/lib/browser/authentication-service.js +1 -1
- package/lib/browser/authentication-service.js.map +1 -1
- package/lib/browser/breadcrumbs/breadcrumb-renderer.js +2 -22
- package/lib/browser/breadcrumbs/breadcrumb-renderer.js.map +1 -1
- package/lib/browser/breadcrumbs/breadcrumbs-renderer.js +2 -17
- package/lib/browser/breadcrumbs/breadcrumbs-renderer.js.map +1 -1
- package/lib/browser/browser-clipboard-service.js +1 -0
- package/lib/browser/browser-clipboard-service.js.map +1 -1
- package/lib/browser/catalog.json +148 -37
- package/lib/browser/components/card.js +4 -10
- package/lib/browser/components/card.js.map +1 -1
- package/lib/browser/connection-status-service.d.ts +1 -0
- package/lib/browser/connection-status-service.d.ts.map +1 -1
- package/lib/browser/connection-status-service.js +7 -0
- package/lib/browser/connection-status-service.js.map +1 -1
- package/lib/browser/dialogs/react-dialog.js +2 -17
- package/lib/browser/dialogs/react-dialog.js.map +1 -1
- package/lib/browser/dialogs/react-dialog.spec.js +3 -3
- package/lib/browser/dialogs/react-dialog.spec.js.map +1 -1
- package/lib/browser/dialogs.d.ts +1 -1
- package/lib/browser/dialogs.d.ts.map +1 -1
- package/lib/browser/dialogs.js +4 -3
- package/lib/browser/dialogs.js.map +1 -1
- package/lib/browser/frontend-application-state.js +1 -0
- package/lib/browser/frontend-application-state.js.map +1 -1
- package/lib/browser/hover-service.d.ts.map +1 -1
- package/lib/browser/hover-service.js +13 -0
- package/lib/browser/hover-service.js.map +1 -1
- package/lib/browser/icon-theme-service.d.ts +5 -3
- package/lib/browser/icon-theme-service.d.ts.map +1 -1
- package/lib/browser/icon-theme-service.js +7 -1
- package/lib/browser/icon-theme-service.js.map +1 -1
- package/lib/browser/keyboard/browser-keyboard-layout-provider.js +1 -0
- package/lib/browser/keyboard/browser-keyboard-layout-provider.js.map +1 -1
- package/lib/browser/markdown-rendering/markdown-link-handler.d.ts +11 -0
- package/lib/browser/markdown-rendering/markdown-link-handler.d.ts.map +1 -1
- package/lib/browser/markdown-rendering/markdown-link-handler.js +23 -1
- package/lib/browser/markdown-rendering/markdown-link-handler.js.map +1 -1
- package/lib/browser/markdown-rendering/markdown-renderer.d.ts +11 -0
- package/lib/browser/markdown-rendering/markdown-renderer.d.ts.map +1 -1
- package/lib/browser/markdown-rendering/markdown-renderer.js +41 -0
- package/lib/browser/markdown-rendering/markdown-renderer.js.map +1 -1
- package/lib/browser/markdown-rendering/markdown-renderer.spec.d.ts +2 -0
- package/lib/browser/markdown-rendering/markdown-renderer.spec.d.ts.map +1 -0
- package/lib/browser/markdown-rendering/markdown-renderer.spec.js +79 -0
- package/lib/browser/markdown-rendering/markdown-renderer.spec.js.map +1 -0
- package/lib/browser/markdown-rendering/markdown.js +6 -5
- package/lib/browser/markdown-rendering/markdown.js.map +1 -1
- package/lib/browser/markdown-rendering/markdown.spec.js +16 -16
- package/lib/browser/markdown-rendering/markdown.spec.js.map +1 -1
- package/lib/browser/messaging/ws-connection-source.d.ts.map +1 -1
- package/lib/browser/messaging/ws-connection-source.js +3 -0
- package/lib/browser/messaging/ws-connection-source.js.map +1 -1
- package/lib/browser/open-with-service.d.ts +2 -1
- package/lib/browser/open-with-service.d.ts.map +1 -1
- package/lib/browser/open-with-service.js +6 -1
- package/lib/browser/open-with-service.js.map +1 -1
- package/lib/browser/performance/frontend-stopwatch.d.ts +2 -1
- package/lib/browser/performance/frontend-stopwatch.d.ts.map +1 -1
- package/lib/browser/performance/frontend-stopwatch.js +6 -1
- package/lib/browser/performance/frontend-stopwatch.js.map +1 -1
- package/lib/browser/perspective-service.js +1 -1
- package/lib/browser/perspective-service.js.map +1 -1
- package/lib/browser/preferences/preference-proxy.spec.js +3 -0
- package/lib/browser/preferences/preference-proxy.spec.js.map +1 -1
- package/lib/browser/preferences/preference-service.spec.js +3 -0
- package/lib/browser/preferences/preference-service.spec.js.map +1 -1
- package/lib/browser/preferences/preference-validation-service.js +1 -1
- package/lib/browser/preferences/preference-validation-service.js.map +1 -1
- package/lib/browser/saveable-service.d.ts +2 -1
- package/lib/browser/saveable-service.d.ts.map +1 -1
- package/lib/browser/saveable-service.js +6 -1
- package/lib/browser/saveable-service.js.map +1 -1
- package/lib/browser/shell/application-shell.js +3 -3
- package/lib/browser/shell/application-shell.js.map +1 -1
- package/lib/browser/shell/application-shell.spec.d.ts +2 -0
- package/lib/browser/shell/application-shell.spec.d.ts.map +1 -0
- package/lib/browser/shell/application-shell.spec.js +57 -0
- package/lib/browser/shell/application-shell.spec.js.map +1 -0
- package/lib/browser/shell/shell-layout-restorer.d.ts +1 -1
- package/lib/browser/shell/shell-layout-restorer.d.ts.map +1 -1
- package/lib/browser/shell/shell-layout-restorer.js +5 -4
- package/lib/browser/shell/shell-layout-restorer.js.map +1 -1
- package/lib/browser/shell/sidebar-menu-widget.js +6 -7
- package/lib/browser/shell/sidebar-menu-widget.js.map +1 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-menu-adapters.d.ts.map +1 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-menu-adapters.js +4 -22
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-menu-adapters.js.map +1 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-registry.d.ts +2 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-registry.d.ts.map +1 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-registry.js +6 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-registry.js.map +1 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar.js +8 -10
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar.js.map +1 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-toolbar-item.js +2 -20
- package/lib/browser/shell/tab-bar-toolbar/tab-toolbar-item.js.map +1 -1
- package/lib/browser/source-tree/source-tree-widget.js +3 -18
- package/lib/browser/source-tree/source-tree-widget.js.map +1 -1
- package/lib/browser/status-bar/status-bar-view-model.d.ts +2 -1
- package/lib/browser/status-bar/status-bar-view-model.d.ts.map +1 -1
- package/lib/browser/status-bar/status-bar-view-model.js +6 -1
- package/lib/browser/status-bar/status-bar-view-model.js.map +1 -1
- package/lib/browser/status-bar/status-bar.js +10 -11
- package/lib/browser/status-bar/status-bar.js.map +1 -1
- package/lib/browser/storage-service.d.ts +1 -1
- package/lib/browser/storage-service.d.ts.map +1 -1
- package/lib/browser/storage-service.js +1 -0
- package/lib/browser/storage-service.js.map +1 -1
- package/lib/browser/tooltip-service.js +5 -5
- package/lib/browser/tooltip-service.js.map +1 -1
- package/lib/browser/tree/search-box.js +9 -16
- package/lib/browser/tree/search-box.js.map +1 -1
- package/lib/browser/tree/tree-compression/compressed-tree-widget.js +7 -9
- package/lib/browser/tree/tree-compression/compressed-tree-widget.js.map +1 -1
- package/lib/browser/tree/tree-model.d.ts.map +1 -1
- package/lib/browser/tree/tree-model.js +1 -0
- package/lib/browser/tree/tree-model.js.map +1 -1
- package/lib/browser/tree/tree-view-welcome-widget.js +8 -30
- package/lib/browser/tree/tree-view-welcome-widget.js.map +1 -1
- package/lib/browser/tree/tree-widget.js +30 -42
- package/lib/browser/tree/tree-widget.js.map +1 -1
- package/lib/browser/widget-manager.js +1 -0
- package/lib/browser/widget-manager.js.map +1 -1
- package/lib/browser/widgets/alert-message.js +4 -8
- package/lib/browser/widgets/alert-message.js.map +1 -1
- package/lib/browser/widgets/react-renderer.js +5 -4
- package/lib/browser/widgets/react-renderer.js.map +1 -1
- package/lib/browser/widgets/react-widget.js +5 -4
- package/lib/browser/widgets/react-widget.js.map +1 -1
- package/lib/browser/widgets/select-component.d.ts +2 -2
- package/lib/browser/widgets/select-component.d.ts.map +1 -1
- package/lib/browser/widgets/select-component.js +14 -19
- package/lib/browser/widgets/select-component.js.map +1 -1
- package/lib/browser/window/default-secondary-window-service.d.ts +2 -1
- package/lib/browser/window/default-secondary-window-service.d.ts.map +1 -1
- package/lib/browser/window/default-secondary-window-service.js +9 -4
- package/lib/browser/window/default-secondary-window-service.js.map +1 -1
- package/lib/browser-only/frontend-only-application-module.d.ts.map +1 -1
- package/lib/browser-only/frontend-only-application-module.js +25 -1
- package/lib/browser-only/frontend-only-application-module.js.map +1 -1
- package/lib/common/command.d.ts +37 -0
- package/lib/common/command.d.ts.map +1 -1
- package/lib/common/command.js +74 -4
- package/lib/common/command.js.map +1 -1
- package/lib/common/command.spec.js +109 -0
- package/lib/common/command.spec.js.map +1 -1
- package/lib/common/message-service-protocol.d.ts +2 -0
- package/lib/common/message-service-protocol.d.ts.map +1 -1
- package/lib/common/message-service-protocol.js +8 -2
- package/lib/common/message-service-protocol.js.map +1 -1
- package/lib/common/performance/stopwatch.js +1 -0
- package/lib/common/performance/stopwatch.js.map +1 -1
- package/lib/common/preferences/preference-schema-service.d.ts +2 -0
- package/lib/common/preferences/preference-schema-service.d.ts.map +1 -1
- package/lib/common/preferences/preference-schema-service.js +11 -5
- package/lib/common/preferences/preference-schema-service.js.map +1 -1
- package/lib/common/preferences/preference-service.d.ts +2 -0
- package/lib/common/preferences/preference-service.d.ts.map +1 -1
- package/lib/common/preferences/preference-service.js +7 -1
- package/lib/common/preferences/preference-service.js.map +1 -1
- package/lib/electron-browser/window/window-zoom-action-bar.js +6 -11
- package/lib/electron-browser/window/window-zoom-action-bar.js.map +1 -1
- package/lib/node/backend-application.js +6 -6
- package/lib/node/backend-application.js.map +1 -1
- package/lib/node/backend-application.spec.js +6 -3
- package/lib/node/backend-application.spec.js.map +1 -1
- package/lib/node/console-logger-server.d.ts.map +1 -1
- package/lib/node/console-logger-server.js +2 -0
- package/lib/node/console-logger-server.js.map +1 -1
- package/lib/node/env-variables/env-variables-server.d.ts +2 -0
- package/lib/node/env-variables/env-variables-server.d.ts.map +1 -1
- package/lib/node/env-variables/env-variables-server.js +7 -1
- package/lib/node/env-variables/env-variables-server.js.map +1 -1
- package/lib/node/hosting/browser-connection-token.d.ts +2 -0
- package/lib/node/hosting/browser-connection-token.d.ts.map +1 -1
- package/lib/node/hosting/browser-connection-token.js +14 -1
- package/lib/node/hosting/browser-connection-token.js.map +1 -1
- package/lib/node/hosting/browser-connection-token.spec.js +25 -2
- package/lib/node/hosting/browser-connection-token.spec.js.map +1 -1
- package/lib/node/key-store-server.d.ts +2 -0
- package/lib/node/key-store-server.d.ts.map +1 -1
- package/lib/node/key-store-server.js +6 -1
- package/lib/node/key-store-server.js.map +1 -1
- package/lib/node/logger-cli-contribution.d.ts.map +1 -1
- package/lib/node/logger-cli-contribution.js.map +1 -1
- package/lib/node/messaging/default-messaging-service.js +1 -1
- package/lib/node/messaging/default-messaging-service.js.map +1 -1
- package/lib/node/messaging/ipc-connection-provider.js +1 -0
- package/lib/node/messaging/ipc-connection-provider.js.map +1 -1
- package/lib/node/messaging/websocket-endpoint.js +1 -1
- package/lib/node/messaging/websocket-endpoint.js.map +1 -1
- package/lib/node/messaging/websocket-frontend-connection-service.d.ts +2 -1
- package/lib/node/messaging/websocket-frontend-connection-service.d.ts.map +1 -1
- package/lib/node/messaging/websocket-frontend-connection-service.js +11 -6
- package/lib/node/messaging/websocket-frontend-connection-service.js.map +1 -1
- package/lib/node/setting-service.js +1 -0
- package/lib/node/setting-service.js.map +1 -1
- package/package.json +32 -29
- package/shared/react/jsx-dev-runtime/index.d.ts +1 -0
- package/shared/react/jsx-dev-runtime/index.js +1 -0
- package/shared/react/jsx-runtime/index.d.ts +1 -0
- package/shared/react/jsx-runtime/index.js +1 -0
- package/shared/react-dom/server/index.d.ts +1 -0
- package/shared/react-dom/server/index.js +1 -0
- package/src/browser/authentication-service.ts +1 -1
- package/src/browser/browser-clipboard-service.ts +2 -2
- package/src/browser/connection-status-service.ts +7 -3
- package/src/browser/dialogs.ts +3 -2
- package/src/browser/frontend-application-state.ts +2 -2
- package/src/browser/hover-service.ts +13 -0
- package/src/browser/icon-theme-service.ts +6 -2
- package/src/browser/keyboard/browser-keyboard-layout-provider.ts +2 -2
- package/src/browser/markdown-rendering/markdown-link-handler.ts +23 -1
- package/src/browser/markdown-rendering/markdown-renderer.spec.ts +88 -0
- package/src/browser/markdown-rendering/markdown-renderer.ts +43 -0
- package/src/browser/messaging/ws-connection-source.ts +4 -0
- package/src/browser/open-with-service.ts +6 -3
- package/src/browser/performance/frontend-stopwatch.ts +6 -3
- package/src/browser/perspective-service.ts +1 -1
- package/src/browser/preferences/preference-proxy.spec.ts +3 -0
- package/src/browser/preferences/preference-service.spec.ts +3 -0
- package/src/browser/preferences/preference-validation-service.ts +1 -1
- package/src/browser/saveable-service.ts +5 -2
- package/src/browser/shell/application-shell.spec.ts +62 -0
- package/src/browser/shell/application-shell.ts +4 -4
- package/src/browser/shell/shell-layout-restorer.ts +6 -5
- package/src/browser/shell/tab-bar-toolbar/tab-bar-toolbar-menu-adapters.tsx +3 -2
- package/src/browser/shell/tab-bar-toolbar/tab-bar-toolbar-registry.ts +5 -2
- package/src/browser/status-bar/status-bar-view-model.ts +7 -3
- package/src/browser/storage-service.ts +4 -2
- package/src/browser/style/sidepanel.css +2 -0
- package/src/browser/style/tabs.css +2 -0
- package/src/browser/style/view-container.css +2 -0
- package/src/browser/tree/tree-model.ts +4 -2
- package/src/browser/widget-manager.ts +1 -1
- package/src/browser/window/default-secondary-window-service.ts +9 -6
- package/src/browser-only/frontend-only-application-module.ts +25 -1
- package/src/common/command.spec.ts +125 -0
- package/src/common/command.ts +77 -4
- package/src/common/i18n/nls.metadata.json +3933 -1186
- package/src/common/message-service-protocol.ts +7 -3
- package/src/common/performance/stopwatch.ts +2 -2
- package/src/common/preferences/preference-schema-service.ts +9 -5
- package/src/common/preferences/preference-service.ts +6 -2
- package/src/node/backend-application.spec.ts +6 -3
- package/src/node/backend-application.ts +6 -6
- package/src/node/console-logger-server.ts +3 -0
- package/src/node/env-variables/env-variables-server.ts +6 -2
- package/src/node/hosting/browser-connection-token.spec.ts +30 -3
- package/src/node/hosting/browser-connection-token.ts +13 -2
- package/src/node/key-store-server.ts +6 -3
- package/src/node/logger-cli-contribution.ts +3 -0
- package/src/node/messaging/default-messaging-service.ts +1 -1
- package/src/node/messaging/ipc-connection-provider.ts +2 -2
- package/src/node/messaging/websocket-endpoint.ts +1 -1
- package/src/node/messaging/websocket-frontend-connection-service.ts +11 -8
- package/src/node/setting-service.ts +2 -2
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { injectable, postConstruct, inject } from 'inversify';
|
|
17
|
+
import { injectable, postConstruct, inject, named } from 'inversify';
|
|
18
18
|
import { isOSX } from '../../common/os';
|
|
19
19
|
import { Emitter, Event } from '../../common/event';
|
|
20
20
|
import { ILogger } from '../../common/logger';
|
|
@@ -29,7 +29,7 @@ export type KeyboardLayoutSource = 'navigator.keyboard' | 'user-choice' | 'press
|
|
|
29
29
|
@injectable()
|
|
30
30
|
export class BrowserKeyboardLayoutProvider implements KeyboardLayoutProvider, KeyboardLayoutChangeNotifier, KeyValidator {
|
|
31
31
|
|
|
32
|
-
@inject(ILogger)
|
|
32
|
+
@inject(ILogger) @named('core:BrowserKeyboardLayoutProvider')
|
|
33
33
|
protected readonly logger: ILogger;
|
|
34
34
|
|
|
35
35
|
@inject(LocalStorageService)
|
|
@@ -19,6 +19,19 @@ import { MarkdownString } from '../../common/markdown-rendering/markdown-string'
|
|
|
19
19
|
import URI from '../../common/uri';
|
|
20
20
|
import { open, OpenerService } from '../opener-service';
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Marks an element whose markdown links are already routed through an {@link OpenerService}.
|
|
24
|
+
*
|
|
25
|
+
* Renderers that install their own link handling declare it with {@link markMarkdownLinksWired},
|
|
26
|
+
* so that {@link wireMarkdownLinkHandler} does not add a second handler and open every link twice.
|
|
27
|
+
*/
|
|
28
|
+
export const MARKDOWN_LINKS_WIRED_ATTRIBUTE = 'data-theia-markdown-links-wired';
|
|
29
|
+
|
|
30
|
+
/** Declares that the element's markdown links are already routed through an {@link OpenerService}. */
|
|
31
|
+
export function markMarkdownLinksWired(root: HTMLElement): void {
|
|
32
|
+
root.setAttribute(MARKDOWN_LINKS_WIRED_ATTRIBUTE, 'true');
|
|
33
|
+
}
|
|
34
|
+
|
|
22
35
|
/**
|
|
23
36
|
* Wires up anchor clicks inside a rendered markdown element so that they are routed
|
|
24
37
|
* through the {@link OpenerService} instead of relying on default browser navigation.
|
|
@@ -27,6 +40,8 @@ import { open, OpenerService } from '../opener-service';
|
|
|
27
40
|
* Also sets the `title` attribute on each anchor to its `href` (when no title is set)
|
|
28
41
|
* so users can hover to see the link target.
|
|
29
42
|
*
|
|
43
|
+
* Does nothing if the element's links are already wired, see {@link markMarkdownLinksWired}.
|
|
44
|
+
*
|
|
30
45
|
* @returns a {@link Disposable} that removes the click listener.
|
|
31
46
|
*/
|
|
32
47
|
export function wireMarkdownLinkHandler(
|
|
@@ -34,6 +49,10 @@ export function wireMarkdownLinkHandler(
|
|
|
34
49
|
source: MarkdownString,
|
|
35
50
|
openerService: OpenerService
|
|
36
51
|
): Disposable {
|
|
52
|
+
if (root.hasAttribute(MARKDOWN_LINKS_WIRED_ATTRIBUTE)) {
|
|
53
|
+
return Disposable.NULL;
|
|
54
|
+
}
|
|
55
|
+
markMarkdownLinksWired(root);
|
|
37
56
|
for (const anchor of root.querySelectorAll('a')) {
|
|
38
57
|
const href = anchor.getAttribute('href');
|
|
39
58
|
if (href && !anchor.hasAttribute('title')) {
|
|
@@ -57,5 +76,8 @@ export function wireMarkdownLinkHandler(
|
|
|
57
76
|
}
|
|
58
77
|
};
|
|
59
78
|
root.addEventListener('click', handleClick);
|
|
60
|
-
return Disposable.create(() =>
|
|
79
|
+
return Disposable.create(() => {
|
|
80
|
+
root.removeEventListener('click', handleClick);
|
|
81
|
+
root.removeAttribute(MARKDOWN_LINKS_WIRED_ATTRIBUTE);
|
|
82
|
+
});
|
|
61
83
|
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2026 Safi Seid-Ahmad, K2view 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 '../test/jsdom';
|
|
18
|
+
const disableJSDOM = enableJSDOM();
|
|
19
|
+
|
|
20
|
+
import { Container } from 'inversify';
|
|
21
|
+
import { expect } from 'chai';
|
|
22
|
+
import { CommandService } from '../../common';
|
|
23
|
+
import { MarkdownStringImpl } from '../../common/markdown-rendering/markdown-string';
|
|
24
|
+
import { LabelParser } from '../label-parser';
|
|
25
|
+
import { MarkdownRenderer, MarkdownRendererImpl } from './markdown-renderer';
|
|
26
|
+
|
|
27
|
+
disableJSDOM();
|
|
28
|
+
|
|
29
|
+
describe('MarkdownRendererImpl', () => {
|
|
30
|
+
let restoreJSDOM: () => void;
|
|
31
|
+
let renderer: MarkdownRenderer;
|
|
32
|
+
|
|
33
|
+
before(() => {
|
|
34
|
+
restoreJSDOM = enableJSDOM();
|
|
35
|
+
const container = new Container();
|
|
36
|
+
container.bind(LabelParser).toSelf().inSingletonScope();
|
|
37
|
+
container.bind(CommandService).toConstantValue({
|
|
38
|
+
executeCommand: <T>(): Promise<T | undefined> => Promise.resolve(undefined)
|
|
39
|
+
});
|
|
40
|
+
container.bind(MarkdownRendererImpl).toSelf().inSingletonScope();
|
|
41
|
+
container.bind(MarkdownRenderer).toService(MarkdownRendererImpl);
|
|
42
|
+
renderer = container.get<MarkdownRenderer>(MarkdownRenderer);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
after(() => {
|
|
46
|
+
restoreJSDOM();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
function renderImage(markdown: string): HTMLImageElement {
|
|
50
|
+
const { element } = renderer.render(new MarkdownStringImpl(markdown));
|
|
51
|
+
const image = element.querySelector('img');
|
|
52
|
+
expect(image, `image rendered for '${markdown}'`).to.not.be.null;
|
|
53
|
+
return image!;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
it('applies the width and height of an image sizing suffix', () => {
|
|
57
|
+
const image = renderImage('');
|
|
58
|
+
expect(image.getAttribute('src')).to.equal('https://avatars.example.com/u/1');
|
|
59
|
+
expect(image.getAttribute('width')).to.equal('20');
|
|
60
|
+
expect(image.getAttribute('height')).to.equal('20');
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('applies a suffix that sets only one dimension', () => {
|
|
64
|
+
const image = renderImage('');
|
|
65
|
+
expect(image.getAttribute('src')).to.equal('https://avatars.example.com/u/1');
|
|
66
|
+
expect(image.getAttribute('width')).to.equal('20');
|
|
67
|
+
expect(image.hasAttribute('height')).to.be.false;
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// markdown-it percent-encodes the link destination, so a pipe it keeps shows up as `%7C`.
|
|
71
|
+
it('keeps a literal pipe that is not a well-formed sizing suffix', () => {
|
|
72
|
+
const image = renderImage('');
|
|
73
|
+
expect(image.getAttribute('src')).to.equal('https://avatars.example.com/u/1%7Cv=2');
|
|
74
|
+
expect(image.hasAttribute('width')).to.be.false;
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('ignores a non-numeric dimension', () => {
|
|
78
|
+
const image = renderImage('');
|
|
79
|
+
expect(image.getAttribute('src')).to.equal('https://avatars.example.com/u/1%7Cwidth=20px');
|
|
80
|
+
expect(image.hasAttribute('width')).to.be.false;
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('renders an image without a suffix unchanged', () => {
|
|
84
|
+
const image = renderImage('');
|
|
85
|
+
expect(image.getAttribute('src')).to.equal('https://avatars.example.com/u/1');
|
|
86
|
+
expect(image.hasAttribute('width')).to.be.false;
|
|
87
|
+
});
|
|
88
|
+
});
|
|
@@ -101,5 +101,48 @@ export class MarkdownRendererImpl implements MarkdownRenderer {
|
|
|
101
101
|
return `<i class="${codicon(chunk.name)} ${chunk.animation ? `fa-${chunk.animation}` : ''} icon-inline"></i>`;
|
|
102
102
|
}).join('');
|
|
103
103
|
};
|
|
104
|
+
|
|
105
|
+
// Support VS Code's `` image sizing syntax, which markdown-it
|
|
106
|
+
// would otherwise fold into the `src` attribute, yielding a broken image.
|
|
107
|
+
const renderImage = this.markdownIt.renderer.rules.image;
|
|
108
|
+
this.markdownIt.renderer.rules.image = (tokens, idx, options, env, self) => {
|
|
109
|
+
const token = tokens[idx];
|
|
110
|
+
const srcIndex = token.attrIndex('src');
|
|
111
|
+
if (srcIndex >= 0 && token.attrs) {
|
|
112
|
+
const src = token.attrs[srcIndex][1];
|
|
113
|
+
// markdown-it percent-encodes the link destination, so the separator may have
|
|
114
|
+
// become `%7C` by the time the token reaches the renderer.
|
|
115
|
+
const separator = /(?:\||%7c)(?![\s\S]*(?:\||%7c))/i.exec(src);
|
|
116
|
+
if (separator) {
|
|
117
|
+
const dimensions = this.parseImageDimensions(src.substring(separator.index + separator[0].length));
|
|
118
|
+
if (dimensions) {
|
|
119
|
+
token.attrs[srcIndex][1] = src.substring(0, separator.index);
|
|
120
|
+
for (const [name, value] of Object.entries(dimensions)) {
|
|
121
|
+
token.attrSet(name, value);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return renderImage ? renderImage(tokens, idx, options, env, self) : self.renderToken(tokens, idx, options);
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Parses the `width=W,height=H` parameter list of an image's sizing suffix.
|
|
132
|
+
*
|
|
133
|
+
* @returns the recognized dimensions, or `undefined` if the suffix is not a well-formed
|
|
134
|
+
* parameter list — in which case it is left as part of the `src`, since it may be a literal
|
|
135
|
+
* `|` in the URL.
|
|
136
|
+
*/
|
|
137
|
+
protected parseImageDimensions(params: string): { width?: string, height?: string } | undefined {
|
|
138
|
+
const dimensions: { width?: string, height?: string } = {};
|
|
139
|
+
for (const param of params.split(',')) {
|
|
140
|
+
const match = /^\s*(width|height)\s*=\s*(\d+)\s*$/.exec(param);
|
|
141
|
+
if (!match) {
|
|
142
|
+
return undefined;
|
|
143
|
+
}
|
|
144
|
+
dimensions[match[1] as 'width' | 'height'] = match[2];
|
|
145
|
+
}
|
|
146
|
+
return Object.keys(dimensions).length > 0 ? dimensions : undefined;
|
|
104
147
|
}
|
|
105
148
|
}
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
+
// Manages the socket the frontend logger's RPC rides on, so logging through an ILogger here
|
|
18
|
+
// would be circular.
|
|
19
|
+
/* eslint-disable @theia/named-logger-check */
|
|
20
|
+
|
|
17
21
|
import { Emitter, Event } from '../../common/event';
|
|
18
22
|
import { ConnectionSource } from './connection-source';
|
|
19
23
|
import { Socket, io } from 'socket.io-client';
|
|
@@ -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 { inject, injectable } from 'inversify';
|
|
17
|
+
import { inject, injectable, named } from 'inversify';
|
|
18
18
|
import { Disposable } from '../common/disposable';
|
|
19
19
|
import { nls } from '../common/nls';
|
|
20
20
|
import { MaybePromise } from '../common/types';
|
|
21
21
|
import { URI } from '../common/uri';
|
|
22
22
|
import { QuickInputService, QuickPickItem, QuickPickItemOrSeparator } from './quick-input';
|
|
23
23
|
import { getDefaultHandler } from './opener-service';
|
|
24
|
-
import { PreferenceService, PreferenceScope } from '../common';
|
|
24
|
+
import { PreferenceService, PreferenceScope, ILogger } from '../common';
|
|
25
25
|
|
|
26
26
|
export interface OpenWithHandler {
|
|
27
27
|
/**
|
|
@@ -74,11 +74,14 @@ export class OpenWithService {
|
|
|
74
74
|
@inject(PreferenceService)
|
|
75
75
|
protected readonly preferenceService: PreferenceService;
|
|
76
76
|
|
|
77
|
+
@inject(ILogger) @named('core:OpenWithService')
|
|
78
|
+
protected readonly logger: ILogger;
|
|
79
|
+
|
|
77
80
|
protected readonly handlers: OpenWithHandler[] = [];
|
|
78
81
|
|
|
79
82
|
registerHandler(handler: OpenWithHandler): Disposable {
|
|
80
83
|
if (this.handlers.some(h => h.id === handler.id)) {
|
|
81
|
-
|
|
84
|
+
this.logger.warn('Duplicate OpenWithHandler registration: ' + handler.id);
|
|
82
85
|
return Disposable.NULL;
|
|
83
86
|
}
|
|
84
87
|
this.handlers.push(handler);
|
|
@@ -14,12 +14,15 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
*******************************************************************************/
|
|
16
16
|
|
|
17
|
-
import { injectable } from 'inversify';
|
|
18
|
-
import { Measurement, MeasurementOptions, Stopwatch } from '../../common';
|
|
17
|
+
import { injectable, inject, named } from 'inversify';
|
|
18
|
+
import { Measurement, MeasurementOptions, Stopwatch, ILogger } from '../../common';
|
|
19
19
|
|
|
20
20
|
@injectable()
|
|
21
21
|
export class FrontendStopwatch extends Stopwatch {
|
|
22
22
|
|
|
23
|
+
@inject(ILogger) @named('core:FrontendStopwatch')
|
|
24
|
+
protected override readonly logger: ILogger;
|
|
25
|
+
|
|
23
26
|
constructor() {
|
|
24
27
|
super({
|
|
25
28
|
owner: 'frontend page',
|
|
@@ -51,7 +54,7 @@ export class FrontendStopwatch extends Stopwatch {
|
|
|
51
54
|
duration = entries[0].duration ?? Number.NaN;
|
|
52
55
|
startTime = entries[0].startTime ?? Number.NaN;
|
|
53
56
|
} catch (e) {
|
|
54
|
-
|
|
57
|
+
this.logger.warn(e);
|
|
55
58
|
duration = Number.NaN;
|
|
56
59
|
startTime = Number.NaN;
|
|
57
60
|
}
|
|
@@ -196,7 +196,7 @@ export class PerspectiveServiceImpl implements FrontendApplicationContribution,
|
|
|
196
196
|
@inject(QuickInputService) @optional()
|
|
197
197
|
protected readonly quickInputService: QuickInputService | undefined;
|
|
198
198
|
|
|
199
|
-
@inject(ILogger) @named('core:
|
|
199
|
+
@inject(ILogger) @named('core:PerspectiveServiceImpl')
|
|
200
200
|
protected readonly logger: ILogger;
|
|
201
201
|
|
|
202
202
|
@inject(WidgetAreaResolver)
|
|
@@ -28,6 +28,8 @@ import { PreferenceScope } from '../../common/preferences/preference-scope';
|
|
|
28
28
|
import { FrontendApplicationConfigProvider } from '../frontend-application-config-provider';
|
|
29
29
|
import { PreferenceProxyOptions, PreferenceProxy, PreferenceChangeEvent, createPreferenceProxy } from '../../common/preferences/preference-proxy';
|
|
30
30
|
import { PreferenceProxyFactory } from '../../common/preferences/injectable-preference-proxy';
|
|
31
|
+
import { ILogger } from '../../common/logger';
|
|
32
|
+
import { MockLogger } from '../../common/test/mock-logger';
|
|
31
33
|
|
|
32
34
|
disableJSDOM();
|
|
33
35
|
|
|
@@ -47,6 +49,7 @@ function createTestContainer(): Container {
|
|
|
47
49
|
const result = new Container();
|
|
48
50
|
bindPreferenceService(result.bind.bind(result));
|
|
49
51
|
bindMockPreferenceProviders(result.bind.bind(result), result.unbind.bind(result));
|
|
52
|
+
result.bind(ILogger).to(MockLogger);
|
|
50
53
|
return result;
|
|
51
54
|
}
|
|
52
55
|
|
|
@@ -28,6 +28,8 @@ import { FrontendApplicationConfigProvider } from '../frontend-application-confi
|
|
|
28
28
|
import { bindMockPreferenceProviders, MockPreferenceProvider } from './test';
|
|
29
29
|
import { PreferenceChangeEvent, createPreferenceProxy } from '../../common/preferences/preference-proxy';
|
|
30
30
|
import { bindPreferenceService } from '../frontend-application-bindings';
|
|
31
|
+
import { ILogger } from '../../common/logger';
|
|
32
|
+
import { MockLogger } from '../../common/test/mock-logger';
|
|
31
33
|
|
|
32
34
|
disableJSDOM();
|
|
33
35
|
|
|
@@ -43,6 +45,7 @@ function createTestContainer(): Container {
|
|
|
43
45
|
const result = new Container();
|
|
44
46
|
bindPreferenceService(result.bind.bind(result));
|
|
45
47
|
bindMockPreferenceProviders(result.bind.bind(result), result.unbind.bind(result));
|
|
48
|
+
result.bind(ILogger).to(MockLogger);
|
|
46
49
|
return result;
|
|
47
50
|
}
|
|
48
51
|
|
|
@@ -175,7 +175,7 @@ export class PreferenceValidationService {
|
|
|
175
175
|
const configuredDefault = this.getDefaultFromSchema(schema);
|
|
176
176
|
return this.validateOneOf(key, configuredDefault, { ...schema, default: undefined });
|
|
177
177
|
}
|
|
178
|
-
|
|
178
|
+
this.logger.info(`While validating ${key}, failed to find a valid value or default value. Using configured value ${value}.`);
|
|
179
179
|
return value;
|
|
180
180
|
}
|
|
181
181
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import type { ApplicationShell } from './shell';
|
|
18
18
|
import { inject, injectable, named } from 'inversify';
|
|
19
|
-
import { ContributionProvider, UNTITLED_SCHEME, URI, Disposable, DisposableCollection, Emitter, Event } from '../common';
|
|
19
|
+
import { ContributionProvider, UNTITLED_SCHEME, URI, Disposable, DisposableCollection, Emitter, Event, ILogger } from '../common';
|
|
20
20
|
import { Navigatable, NavigatableWidget } from './navigatable-types';
|
|
21
21
|
import { AutoSaveMode, Saveable, SaveableSource, SaveableWidget, SaveOptions, SaveReason, setDirty, close, PostCreationSaveableWidget, ShouldSaveDialog } from './saveable';
|
|
22
22
|
import { waitForClosed, Widget } from './widgets';
|
|
@@ -53,6 +53,9 @@ export class SaveableService implements FrontendApplicationContribution {
|
|
|
53
53
|
@inject(WindowFocusService)
|
|
54
54
|
protected readonly windowFocusService: WindowFocusService;
|
|
55
55
|
|
|
56
|
+
@inject(ILogger) @named('core:SaveableService')
|
|
57
|
+
protected readonly logger: ILogger;
|
|
58
|
+
|
|
56
59
|
protected saveThrottles = new Map<Widget, AutoSaveThrottle>();
|
|
57
60
|
protected saveMode: AutoSaveMode = 'off';
|
|
58
61
|
protected saveDelay = 1000;
|
|
@@ -284,7 +287,7 @@ export class SaveableService implements FrontendApplicationContribution {
|
|
|
284
287
|
}
|
|
285
288
|
const saveable = Saveable.get(widget);
|
|
286
289
|
if (!saveable) {
|
|
287
|
-
|
|
290
|
+
this.logger.warn('Saveable.get returned undefined on a known saveable widget. This is unexpected.');
|
|
288
291
|
}
|
|
289
292
|
// Enter branch if saveable absent since we cannot check autosaveability more definitely.
|
|
290
293
|
if (this.autoSave !== 'off' && (!saveable || this.shouldAutoSave(widget, saveable))) {
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2026 Alec Timison.
|
|
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 '../test/jsdom';
|
|
18
|
+
const disableJSDOM = enableJSDOM();
|
|
19
|
+
|
|
20
|
+
import { expect } from 'chai';
|
|
21
|
+
import { Widget } from '@theia/core/shared/@lumino/widgets';
|
|
22
|
+
import * as sinon from 'sinon';
|
|
23
|
+
import { DisposableCollection } from '../../common/disposable';
|
|
24
|
+
import { ApplicationShell } from './application-shell';
|
|
25
|
+
disableJSDOM();
|
|
26
|
+
|
|
27
|
+
describe('ApplicationShell', () => {
|
|
28
|
+
let toTearDown: () => void;
|
|
29
|
+
|
|
30
|
+
beforeEach(() => {
|
|
31
|
+
toTearDown = enableJSDOM();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
afterEach(() => {
|
|
35
|
+
sinon.restore();
|
|
36
|
+
toTearDown();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('cancels the previous activation check', () => {
|
|
40
|
+
const shell = Object.create(ApplicationShell.prototype) as ApplicationShell;
|
|
41
|
+
Object.assign(shell, {
|
|
42
|
+
toDisposeOnActivationCheck: new DisposableCollection(),
|
|
43
|
+
logger: { warn: sinon.stub() }
|
|
44
|
+
});
|
|
45
|
+
const assertActivated = (shell as unknown as { assertActivated(widget: Widget): void }).assertActivated.bind(shell);
|
|
46
|
+
const firstWidget = new Widget();
|
|
47
|
+
const secondWidget = new Widget();
|
|
48
|
+
const request = {} as ReturnType<typeof window.setTimeout>;
|
|
49
|
+
sinon.stub(globalThis, 'setTimeout').returns(request);
|
|
50
|
+
sinon.stub(window, 'setTimeout').returns(request);
|
|
51
|
+
const clearTimeout = sinon.stub(window, 'clearTimeout');
|
|
52
|
+
window.cancelAnimationFrame = sinon.stub();
|
|
53
|
+
|
|
54
|
+
assertActivated(firstWidget);
|
|
55
|
+
assertActivated(secondWidget);
|
|
56
|
+
|
|
57
|
+
expect(clearTimeout.callCount).to.equal(1);
|
|
58
|
+
expect(clearTimeout.firstCall.args[0]).to.equal(request);
|
|
59
|
+
firstWidget.dispose();
|
|
60
|
+
secondWidget.dispose();
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -1438,7 +1438,7 @@ export class ApplicationShell extends Widget {
|
|
|
1438
1438
|
this.toDisposeOnActivationCheck.push(Disposable.create(() => widget.disposed.disconnect(onDispose)));
|
|
1439
1439
|
|
|
1440
1440
|
let start = 0;
|
|
1441
|
-
const step
|
|
1441
|
+
const step = (): void => {
|
|
1442
1442
|
const activeElement = widget.node.ownerDocument.activeElement;
|
|
1443
1443
|
if (activeElement && widget.node.contains(activeElement)) {
|
|
1444
1444
|
return;
|
|
@@ -1449,13 +1449,13 @@ export class ApplicationShell extends Widget {
|
|
|
1449
1449
|
}
|
|
1450
1450
|
const delta = now - start;
|
|
1451
1451
|
if (delta < this.activationTimeout) {
|
|
1452
|
-
request = setTimeout(step, 0);
|
|
1452
|
+
request = window.setTimeout(step, 0);
|
|
1453
1453
|
} else {
|
|
1454
1454
|
this.logger.warn(`Widget was activated, but did not accept focus after ${this.activationTimeout}ms: ${widget.id}`);
|
|
1455
1455
|
}
|
|
1456
1456
|
};
|
|
1457
|
-
let request = setTimeout(step, 0);
|
|
1458
|
-
this.toDisposeOnActivationCheck.push(Disposable.create(() => window.
|
|
1457
|
+
let request = window.setTimeout(step, 0);
|
|
1458
|
+
this.toDisposeOnActivationCheck.push(Disposable.create(() => window.clearTimeout(request)));
|
|
1459
1459
|
}
|
|
1460
1460
|
|
|
1461
1461
|
/**
|
|
@@ -154,7 +154,8 @@ export class ShellLayoutRestorer implements CommandContribution {
|
|
|
154
154
|
|
|
155
155
|
constructor(
|
|
156
156
|
@inject(WidgetManager) protected widgetManager: WidgetManager,
|
|
157
|
-
@inject(ILogger)
|
|
157
|
+
@inject(ILogger) @named('core:ShellLayoutRestorer')
|
|
158
|
+
protected readonly logger: ILogger,
|
|
158
159
|
@inject(StorageService) protected storageService: StorageService) { }
|
|
159
160
|
|
|
160
161
|
registerCommands(commands: CommandRegistry): void {
|
|
@@ -374,18 +375,18 @@ export class ShellLayoutRestorer implements CommandContribution {
|
|
|
374
375
|
}
|
|
375
376
|
if (layoutVersion !== applicationShellLayoutVersion) {
|
|
376
377
|
if (layoutVersion < applicationShellLayoutVersion) {
|
|
377
|
-
|
|
378
|
+
this.logger.warn(`Layout version ${layoutVersion} is behind current layout version ${applicationShellLayoutVersion}, trying to migrate...`);
|
|
378
379
|
} else {
|
|
379
|
-
|
|
380
|
+
this.logger.warn(`Layout version ${layoutVersion} is ahead current layout version ${applicationShellLayoutVersion}, trying to load anyway...`);
|
|
380
381
|
}
|
|
381
|
-
|
|
382
|
+
this.logger.info(`Please use '${RESET_LAYOUT.label}' command if the layout looks bogus.`);
|
|
382
383
|
}
|
|
383
384
|
|
|
384
385
|
const migrations = this.migrations.getContributions()
|
|
385
386
|
.filter(m => m.layoutVersion > layoutVersion && m.layoutVersion <= applicationShellLayoutVersion)
|
|
386
387
|
.sort((m, m2) => m.layoutVersion - m2.layoutVersion);
|
|
387
388
|
if (migrations.length) {
|
|
388
|
-
|
|
389
|
+
this.logger.info(`Found ${migrations.length} migrations from layout version ${layoutVersion} to version ${applicationShellLayoutVersion}, migrating...`);
|
|
389
390
|
}
|
|
390
391
|
|
|
391
392
|
const context = { layout, layoutVersion, migrations };
|
|
@@ -96,8 +96,9 @@ abstract class AbstractToolbarMenuWrapper {
|
|
|
96
96
|
const icon = this.icon || 'ellipsis';
|
|
97
97
|
const contextMatcher: ContextMatcher = this.contextKeyService;
|
|
98
98
|
const className = `${icon} ${ACTION_ITEM}`;
|
|
99
|
+
const itemClassName = TabBarToolbar.Styles.TAB_BAR_TOOLBAR_ITEM + ' enabled menu' + (this.isToggled(widget) ? ' toggled' : '');
|
|
99
100
|
if (CompoundMenuNode.is(this.menuNode) && !this.menuNode.isEmpty(this.effectiveMenuPath, this.contextKeyService, widget.node, widget)) {
|
|
100
|
-
return <div key={this.id} className={
|
|
101
|
+
return <div key={this.id} className={itemClassName}>
|
|
101
102
|
<div id={this.id} className={className}
|
|
102
103
|
title={this.tooltip || this.text}
|
|
103
104
|
onClick={e => this.executeCommand(widget, e)}
|
|
@@ -107,7 +108,7 @@ abstract class AbstractToolbarMenuWrapper {
|
|
|
107
108
|
</div>
|
|
108
109
|
</div>;
|
|
109
110
|
} else {
|
|
110
|
-
return <div key={this.id} className={
|
|
111
|
+
return <div key={this.id} className={itemClassName}>
|
|
111
112
|
<div id={this.id} className={className}
|
|
112
113
|
title={this.tooltip || this.text}
|
|
113
114
|
onClick={e => this.executeCommand(widget, e)}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import debounce = require('lodash.debounce');
|
|
18
18
|
import { inject, injectable, named } from 'inversify';
|
|
19
19
|
// eslint-disable-next-line max-len
|
|
20
|
-
import { CommandRegistry, ContributionProvider, Disposable, DisposableCollection, Emitter, Event, MenuModelRegistry, MenuPath } from '../../../common';
|
|
20
|
+
import { CommandRegistry, ContributionProvider, Disposable, DisposableCollection, Emitter, Event, MenuModelRegistry, MenuPath, ILogger } from '../../../common';
|
|
21
21
|
import { ContextKeyService } from '../../context-key-service';
|
|
22
22
|
import { FrontendApplicationContribution } from '../../frontend-application-contribution';
|
|
23
23
|
import { Widget } from '../../widgets';
|
|
@@ -68,6 +68,9 @@ export class TabBarToolbarRegistry implements FrontendApplicationContribution {
|
|
|
68
68
|
@inject(ContributionProvider) @named(TabBarToolbarContribution)
|
|
69
69
|
protected readonly contributionProvider: ContributionProvider<TabBarToolbarContribution>;
|
|
70
70
|
|
|
71
|
+
@inject(ILogger) @named('core:TabBarToolbarRegistry')
|
|
72
|
+
protected readonly logger: ILogger;
|
|
73
|
+
|
|
71
74
|
protected readonly onDidChangeEmitter = new Emitter<void>();
|
|
72
75
|
readonly onDidChange: Event<void> = this.onDidChangeEmitter.event;
|
|
73
76
|
// debounce in order to avoid to fire more than once in the same tick
|
|
@@ -223,7 +226,7 @@ export class TabBarToolbarRegistry implements FrontendApplicationContribution {
|
|
|
223
226
|
this.fireOnDidChange();
|
|
224
227
|
return { dispose: () => this.unregisterMenuDelegate(menuPath) };
|
|
225
228
|
}
|
|
226
|
-
|
|
229
|
+
this.logger.warn('Unable to register menu delegate. Delegate has already been registered', menuPath);
|
|
227
230
|
return Disposable.NULL;
|
|
228
231
|
}
|
|
229
232
|
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { injectable } from 'inversify';
|
|
18
|
-
import { ArrayUtils, Emitter, Event } from '../../common';
|
|
17
|
+
import { injectable, inject, named } from 'inversify';
|
|
18
|
+
import { ArrayUtils, Emitter, Event, ILogger } from '../../common';
|
|
19
19
|
import { StatusBarAlignment, StatusBarEntry, StatusBarViewEntry, StatusBarViewModelEntry } from './status-bar-types';
|
|
20
20
|
|
|
21
21
|
interface EntryLocation {
|
|
@@ -30,6 +30,10 @@ export class StatusBarViewModel {
|
|
|
30
30
|
protected rightTree = new Array<StatusBarViewModelEntry>();
|
|
31
31
|
protected containerPointers = new Map<string, StatusBarViewModelEntry[]>();
|
|
32
32
|
protected onDidChangeEmitter = new Emitter<void>();
|
|
33
|
+
|
|
34
|
+
@inject(ILogger) @named('core:StatusBarViewModel')
|
|
35
|
+
protected readonly logger: ILogger;
|
|
36
|
+
|
|
33
37
|
get onDidChange(): Event<void> {
|
|
34
38
|
return this.onDidChangeEmitter.event;
|
|
35
39
|
}
|
|
@@ -53,7 +57,7 @@ export class StatusBarViewModel {
|
|
|
53
57
|
*getChildren(list: StatusBarViewModelEntry[], alignment: StatusBarAlignment, compact?: boolean): IterableIterator<StatusBarViewEntry> {
|
|
54
58
|
for (const item of list) {
|
|
55
59
|
if (item.leftChildren.length || item.rightChildren.length) {
|
|
56
|
-
|
|
60
|
+
this.logger.warn(`Found embedded entries with affinity to ${item.id}. They will inherit alignment and compactness of parent.`);
|
|
57
61
|
}
|
|
58
62
|
yield* this.getChildren(item.leftChildren, alignment, item.head.affinity?.compact);
|
|
59
63
|
yield { entry: item.head, id: item.id, alignment, compact: compact || item.head.affinity?.compact };
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { inject, injectable, postConstruct } from 'inversify';
|
|
17
|
+
import { inject, injectable, postConstruct, named } from 'inversify';
|
|
18
18
|
import { ILogger } from '../common/logger';
|
|
19
19
|
import { MessageService } from '../common/message-service';
|
|
20
20
|
import { WindowService } from './window/window-service';
|
|
@@ -47,7 +47,9 @@ interface LocalStorage {
|
|
|
47
47
|
export class LocalStorageService implements StorageService {
|
|
48
48
|
private storage: LocalStorage;
|
|
49
49
|
|
|
50
|
-
@inject(ILogger)
|
|
50
|
+
@inject(ILogger) @named('core:LocalStorageService')
|
|
51
|
+
protected readonly logger: ILogger;
|
|
52
|
+
|
|
51
53
|
@inject(MessageService) protected readonly messageService: MessageService;
|
|
52
54
|
@inject(WindowService) protected readonly windowService: WindowService;
|
|
53
55
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { inject, injectable, postConstruct } from 'inversify';
|
|
17
|
+
import { inject, injectable, postConstruct, named } from 'inversify';
|
|
18
18
|
import { Event, Emitter, WaitUntilEvent } from '../../common/event';
|
|
19
19
|
import { DisposableCollection } from '../../common/disposable';
|
|
20
20
|
import { CancellationToken } from '../../common/cancellation';
|
|
@@ -165,7 +165,9 @@ export interface TreeModel extends Tree, TreeSelectionService, TreeExpansionServ
|
|
|
165
165
|
@injectable()
|
|
166
166
|
export class TreeModelImpl implements TreeModel, SelectionProvider<ReadonlyArray<Readonly<SelectableTreeNode>>> {
|
|
167
167
|
|
|
168
|
-
@inject(ILogger)
|
|
168
|
+
@inject(ILogger) @named('core:TreeModelImpl')
|
|
169
|
+
protected readonly logger: ILogger;
|
|
170
|
+
|
|
169
171
|
@inject(Tree) protected readonly tree: Tree;
|
|
170
172
|
@inject(TreeSelectionService) protected readonly selectionService: TreeSelectionService;
|
|
171
173
|
@inject(TreeExpansionService) protected readonly expansionService: TreeExpansionService;
|