@theia/plugin-ext 1.18.0 → 1.19.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 +5 -0
- package/lib/common/connection.d.ts +1 -2
- package/lib/common/connection.d.ts.map +1 -1
- package/lib/common/connection.js.map +1 -1
- package/lib/common/plugin-api-rpc-model.d.ts +2 -0
- package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc-model.js.map +1 -1
- package/lib/common/plugin-api-rpc.d.ts +8 -8
- package/lib/common/plugin-api-rpc.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc.js.map +1 -1
- package/lib/common/plugin-protocol.d.ts +1 -0
- package/lib/common/plugin-protocol.d.ts.map +1 -1
- package/lib/common/plugin-protocol.js.map +1 -1
- package/lib/hosted/browser/hosted-plugin.d.ts +4 -5
- package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
- package/lib/hosted/browser/hosted-plugin.js +17 -13
- package/lib/hosted/browser/hosted-plugin.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-deployer-handler.d.ts +1 -1
- package/lib/hosted/node/hosted-plugin-deployer-handler.d.ts.map +1 -1
- package/lib/hosted/node/hosted-plugin-deployer-handler.js +14 -38
- package/lib/hosted/node/hosted-plugin-deployer-handler.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-localization-service.d.ts +37 -0
- package/lib/hosted/node/hosted-plugin-localization-service.d.ts.map +1 -0
- package/lib/hosted/node/hosted-plugin-localization-service.js +197 -0
- package/lib/hosted/node/hosted-plugin-localization-service.js.map +1 -0
- package/lib/hosted/node/hosted-plugin-process.d.ts +2 -2
- package/lib/hosted/node/hosted-plugin-process.d.ts.map +1 -1
- package/lib/hosted/node/hosted-plugin-process.js +5 -7
- package/lib/hosted/node/hosted-plugin-process.js.map +1 -1
- package/lib/hosted/node/plugin-ext-hosted-backend-module.d.ts.map +1 -1
- package/lib/hosted/node/plugin-ext-hosted-backend-module.js +2 -0
- package/lib/hosted/node/plugin-ext-hosted-backend-module.js.map +1 -1
- package/lib/hosted/node/plugin-manifest-loader.d.ts +1 -1
- package/lib/hosted/node/plugin-manifest-loader.d.ts.map +1 -1
- package/lib/hosted/node/plugin-manifest-loader.js +4 -52
- package/lib/hosted/node/plugin-manifest-loader.js.map +1 -1
- package/lib/hosted/node/plugin-service.d.ts +3 -6
- package/lib/hosted/node/plugin-service.d.ts.map +1 -1
- package/lib/hosted/node/plugin-service.js +7 -40
- package/lib/hosted/node/plugin-service.js.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.js +1 -0
- package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
- package/lib/main/browser/callhierarchy/callhierarchy-type-converters.d.ts.map +1 -1
- package/lib/main/browser/callhierarchy/callhierarchy-type-converters.js +5 -2
- package/lib/main/browser/callhierarchy/callhierarchy-type-converters.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-opener.d.ts +1 -2
- package/lib/main/browser/custom-editors/custom-editor-opener.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-opener.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.js +1 -2
- package/lib/main/browser/custom-editors/custom-editors-main.js.map +1 -1
- package/lib/main/browser/debug/debug-main.js +1 -1
- package/lib/main/browser/debug/debug-main.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-factory.d.ts +2 -2
- package/lib/main/browser/debug/plugin-debug-session-factory.d.ts.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-factory.js.map +1 -1
- package/lib/main/browser/dialogs/modal-notification.d.ts +3 -3
- package/lib/main/browser/dialogs/modal-notification.d.ts.map +1 -1
- package/lib/main/browser/dialogs/modal-notification.js +17 -6
- package/lib/main/browser/dialogs/modal-notification.js.map +1 -1
- package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
- package/lib/main/browser/editors-and-documents-main.js +3 -4
- package/lib/main/browser/editors-and-documents-main.js.map +1 -1
- package/lib/main/browser/languages-main.js +1 -1
- package/lib/main/browser/languages-main.js.map +1 -1
- package/lib/main/browser/message-registry-main.js +1 -1
- package/lib/main/browser/message-registry-main.js.map +1 -1
- package/lib/main/browser/quick-open-main.d.ts +1 -1
- package/lib/main/browser/quick-open-main.d.ts.map +1 -1
- package/lib/main/browser/quick-open-main.js.map +1 -1
- package/lib/main/browser/timeline-main.d.ts.map +1 -1
- package/lib/main/browser/timeline-main.js +1 -1
- package/lib/main/browser/timeline-main.js.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.d.ts +3 -2
- package/lib/main/browser/view/plugin-view-registry.d.ts.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.js +63 -23
- package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
- package/lib/main/browser/view/plugin-view-widget.d.ts +2 -0
- package/lib/main/browser/view/plugin-view-widget.d.ts.map +1 -1
- package/lib/main/browser/view/plugin-view-widget.js +3 -1
- package/lib/main/browser/view/plugin-view-widget.js.map +1 -1
- package/lib/main/browser/view/tree-view-widget.d.ts +3 -4
- package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
- package/lib/main/browser/view/tree-view-widget.js +25 -28
- package/lib/main/browser/view/tree-view-widget.js.map +1 -1
- package/lib/main/browser/webview/webview-frontend-security-warnings.d.ts.map +1 -1
- package/lib/main/browser/webview/webview-frontend-security-warnings.js +8 -5
- package/lib/main/browser/webview/webview-frontend-security-warnings.js.map +1 -1
- package/lib/main/browser/webview/webview-preferences.d.ts.map +1 -1
- package/lib/main/browser/webview/webview-preferences.js +3 -2
- package/lib/main/browser/webview/webview-preferences.js.map +1 -1
- package/lib/main/browser/webview/webview.d.ts +1 -1
- package/lib/main/browser/webview/webview.d.ts.map +1 -1
- package/lib/main/browser/webview/webview.js +1 -1
- package/lib/main/browser/webview/webview.js.map +1 -1
- package/lib/plugin/comments.d.ts.map +1 -1
- package/lib/plugin/comments.js +2 -3
- package/lib/plugin/comments.js.map +1 -1
- package/lib/plugin/custom-editors.d.ts +1 -2
- package/lib/plugin/custom-editors.d.ts.map +1 -1
- package/lib/plugin/custom-editors.js +2 -3
- package/lib/plugin/custom-editors.js.map +1 -1
- package/lib/plugin/decorations.d.ts.map +1 -1
- package/lib/plugin/decorations.js +2 -3
- package/lib/plugin/decorations.js.map +1 -1
- package/lib/plugin/document-data.d.ts.map +1 -1
- package/lib/plugin/document-data.js +1 -1
- package/lib/plugin/document-data.js.map +1 -1
- package/lib/plugin/documents.d.ts.map +1 -1
- package/lib/plugin/documents.js +1 -2
- package/lib/plugin/documents.js.map +1 -1
- package/lib/plugin/file-system-event-service-ext-impl.d.ts.map +1 -1
- package/lib/plugin/file-system-event-service-ext-impl.js +2 -3
- package/lib/plugin/file-system-event-service-ext-impl.js.map +1 -1
- package/lib/plugin/file-system-ext-impl.d.ts.map +1 -1
- package/lib/plugin/file-system-ext-impl.js +12 -13
- package/lib/plugin/file-system-ext-impl.js.map +1 -1
- package/lib/plugin/known-commands.spec.js +1 -2
- package/lib/plugin/known-commands.spec.js.map +1 -1
- package/lib/plugin/languages/call-hierarchy.d.ts +1 -1
- package/lib/plugin/languages/call-hierarchy.d.ts.map +1 -1
- package/lib/plugin/languages/call-hierarchy.js +7 -3
- package/lib/plugin/languages/call-hierarchy.js.map +1 -1
- package/lib/plugin/languages/rename.d.ts +1 -2
- package/lib/plugin/languages/rename.d.ts.map +1 -1
- package/lib/plugin/languages/rename.js.map +1 -1
- package/lib/plugin/languages.d.ts +1 -1
- package/lib/plugin/languages.d.ts.map +1 -1
- package/lib/plugin/languages.js.map +1 -1
- package/lib/plugin/message-registry.d.ts.map +1 -1
- package/lib/plugin/message-registry.js +8 -5
- package/lib/plugin/message-registry.js.map +1 -1
- package/lib/plugin/node/debug/debug.d.ts +1 -1
- package/lib/plugin/node/debug/debug.d.ts.map +1 -1
- package/lib/plugin/node/debug/debug.js +10 -4
- package/lib/plugin/node/debug/debug.js.map +1 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-session.d.ts +3 -3
- package/lib/plugin/node/debug/plugin-debug-adapter-session.d.ts.map +1 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-session.js.map +1 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-starter.d.ts +6 -4
- package/lib/plugin/node/debug/plugin-debug-adapter-starter.d.ts.map +1 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-starter.js +23 -13
- package/lib/plugin/node/debug/plugin-debug-adapter-starter.js.map +1 -1
- package/lib/plugin/plugin-context.d.ts.map +1 -1
- package/lib/plugin/plugin-context.js +3 -2
- package/lib/plugin/plugin-context.js.map +1 -1
- package/lib/plugin/plugin-storage.d.ts.map +1 -1
- package/lib/plugin/plugin-storage.js.map +1 -1
- package/lib/plugin/preference-registry.spec.js.map +1 -1
- package/lib/plugin/quick-open.d.ts.map +1 -1
- package/lib/plugin/quick-open.js +9 -2
- package/lib/plugin/quick-open.js.map +1 -1
- package/lib/plugin/timeline.d.ts.map +1 -1
- package/lib/plugin/timeline.js +1 -2
- package/lib/plugin/timeline.js.map +1 -1
- package/lib/plugin/type-converters.d.ts.map +1 -1
- package/lib/plugin/type-converters.js +10 -7
- package/lib/plugin/type-converters.js.map +1 -1
- package/lib/plugin/types-impl.d.ts +34 -0
- package/lib/plugin/types-impl.d.ts.map +1 -1
- package/lib/plugin/types-impl.js +61 -1
- package/lib/plugin/types-impl.js.map +1 -1
- package/lib/plugin/webviews.d.ts +1 -2
- package/lib/plugin/webviews.d.ts.map +1 -1
- package/lib/plugin/webviews.js.map +1 -1
- package/package.json +26 -24
- package/src/common/connection.ts +1 -2
- package/src/common/plugin-api-rpc-model.ts +2 -0
- package/src/common/plugin-api-rpc.ts +8 -7
- package/src/common/plugin-protocol.ts +1 -0
- package/src/hosted/browser/hosted-plugin.ts +16 -11
- package/src/hosted/node/hosted-plugin-deployer-handler.ts +13 -40
- package/src/hosted/node/hosted-plugin-localization-service.ts +201 -0
- package/src/hosted/node/hosted-plugin-process.ts +4 -6
- package/src/hosted/node/plugin-ext-hosted-backend-module.ts +2 -0
- package/src/hosted/node/plugin-manifest-loader.ts +4 -56
- package/src/hosted/node/plugin-service.ts +7 -40
- package/src/hosted/node/scanners/scanner-theia.ts +1 -0
- package/src/main/browser/callhierarchy/callhierarchy-type-converters.ts +5 -2
- package/src/main/browser/custom-editors/custom-editor-opener.tsx +1 -2
- package/src/main/browser/custom-editors/custom-editors-main.ts +1 -2
- package/src/main/browser/debug/debug-main.ts +1 -1
- package/src/main/browser/debug/plugin-debug-session-factory.ts +3 -3
- package/src/main/browser/dialogs/modal-notification.ts +18 -7
- package/src/main/browser/dialogs/style/modal-notification.css +17 -2
- package/src/main/browser/editors-and-documents-main.ts +1 -2
- package/src/main/browser/languages-main.ts +1 -1
- package/src/main/browser/message-registry-main.ts +1 -1
- package/src/main/browser/quick-open-main.ts +1 -1
- package/src/main/browser/timeline-main.ts +1 -2
- package/src/main/browser/view/plugin-view-registry.ts +67 -25
- package/src/main/browser/view/plugin-view-widget.ts +7 -2
- package/src/main/browser/view/tree-view-widget.tsx +41 -46
- package/src/main/browser/webview/pre/host.js +3 -4
- package/src/main/browser/webview/webview-frontend-security-warnings.ts +8 -7
- package/src/main/browser/webview/webview-preferences.ts +3 -2
- package/src/main/browser/webview/webview.ts +1 -1
- package/src/plugin/comments.ts +1 -2
- package/src/plugin/custom-editors.ts +2 -4
- package/src/plugin/decorations.ts +1 -2
- package/src/plugin/document-data.ts +1 -2
- package/src/plugin/documents.ts +1 -2
- package/src/plugin/file-system-event-service-ext-impl.ts +1 -2
- package/src/plugin/file-system-ext-impl.ts +1 -2
- package/src/plugin/known-commands.spec.ts +1 -2
- package/src/plugin/languages/call-hierarchy.ts +13 -5
- package/src/plugin/languages/rename.ts +1 -2
- package/src/plugin/languages.ts +3 -1
- package/src/plugin/message-registry.ts +9 -6
- package/src/plugin/node/debug/debug.ts +14 -7
- package/src/plugin/node/debug/plugin-debug-adapter-session.ts +3 -3
- package/src/plugin/node/debug/plugin-debug-adapter-starter.ts +24 -14
- package/src/plugin/plugin-context.ts +6 -4
- package/src/plugin/plugin-storage.ts +1 -2
- package/src/plugin/preference-registry.spec.ts +1 -2
- package/src/plugin/quick-open.ts +10 -3
- package/src/plugin/timeline.ts +1 -2
- package/src/plugin/type-converters.ts +12 -8
- package/src/plugin/types-impl.ts +53 -0
- package/src/plugin/webviews.ts +1 -2
|
@@ -38,7 +38,7 @@ import { DebugProtocol } from 'vscode-debugprotocol';
|
|
|
38
38
|
import { DebugConfigurationManager } from '@theia/debug/lib/browser/debug-configuration-manager';
|
|
39
39
|
import { TerminalService } from '@theia/terminal/lib/browser/base/terminal-service';
|
|
40
40
|
import { MessageClient } from '@theia/core/lib/common/message-service-protocol';
|
|
41
|
-
import { OutputChannelManager } from '@theia/output/lib/
|
|
41
|
+
import { OutputChannelManager } from '@theia/output/lib/browser/output-channel';
|
|
42
42
|
import { DebugPreferences } from '@theia/debug/lib/browser/debug-preferences';
|
|
43
43
|
import { PluginDebugAdapterContribution } from './plugin-debug-adapter-contribution';
|
|
44
44
|
import { PluginDebugSessionContributionRegistrator, PluginDebugSessionContributionRegistry } from './plugin-debug-session-contribution-registry';
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import { DefaultDebugSessionFactory
|
|
17
|
+
import { DefaultDebugSessionFactory } from '@theia/debug/lib/browser/debug-session-contribution';
|
|
18
18
|
import { TerminalService } from '@theia/terminal/lib/browser/base/terminal-service';
|
|
19
19
|
import { EditorManager } from '@theia/editor/lib/browser/editor-manager';
|
|
20
20
|
import { BreakpointManager } from '@theia/debug/lib/browser/breakpoint/breakpoint-manager';
|
|
21
21
|
import { LabelProvider } from '@theia/core/lib/browser/label-provider';
|
|
22
22
|
import { MessageClient } from '@theia/core/lib/common/message-service-protocol';
|
|
23
|
-
import { OutputChannelManager } from '@theia/output/lib/
|
|
23
|
+
import { OutputChannelManager } from '@theia/output/lib/browser/output-channel';
|
|
24
24
|
import { DebugPreferences } from '@theia/debug/lib/browser/debug-preferences';
|
|
25
25
|
import { DebugSessionOptions } from '@theia/debug/lib/browser/debug-session-options';
|
|
26
26
|
import { DebugSession } from '@theia/debug/lib/browser/debug-session';
|
|
@@ -30,7 +30,7 @@ import { TerminalWidgetOptions, TerminalWidget } from '@theia/terminal/lib/brows
|
|
|
30
30
|
import { TerminalOptionsExt } from '../../../common/plugin-api-rpc';
|
|
31
31
|
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
32
32
|
import { DebugContribution } from '@theia/debug/lib/browser/debug-contribution';
|
|
33
|
-
import { ContributionProvider } from '@theia/core';
|
|
33
|
+
import { ContributionProvider } from '@theia/core/lib/common/contribution-provider';
|
|
34
34
|
|
|
35
35
|
export class PluginDebugSession extends DebugSession {
|
|
36
36
|
constructor(
|
|
@@ -18,7 +18,8 @@ import { Message } from '@theia/core/shared/@phosphor/messaging';
|
|
|
18
18
|
import { codiconArray, Key } from '@theia/core/lib/browser';
|
|
19
19
|
import { AbstractDialog } from '@theia/core/lib/browser/dialogs';
|
|
20
20
|
import '../../../../src/main/browser/dialogs/style/modal-notification.css';
|
|
21
|
-
import { MainMessageItem } from '../../../common/plugin-api-rpc';
|
|
21
|
+
import { MainMessageItem, MainMessageOptions } from '../../../common/plugin-api-rpc';
|
|
22
|
+
import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider';
|
|
22
23
|
|
|
23
24
|
export enum MessageType {
|
|
24
25
|
Error = 'error',
|
|
@@ -29,6 +30,7 @@ export enum MessageType {
|
|
|
29
30
|
const NOTIFICATION = 'modal-Notification';
|
|
30
31
|
const ICON = 'icon';
|
|
31
32
|
const TEXT = 'text';
|
|
33
|
+
const DETAIL = 'detail';
|
|
32
34
|
|
|
33
35
|
@injectable()
|
|
34
36
|
export class ModalNotification extends AbstractDialog<string | undefined> {
|
|
@@ -36,7 +38,7 @@ export class ModalNotification extends AbstractDialog<string | undefined> {
|
|
|
36
38
|
protected actionTitle: string | undefined;
|
|
37
39
|
|
|
38
40
|
constructor() {
|
|
39
|
-
super({ title:
|
|
41
|
+
super({ title: FrontendApplicationConfigProvider.get().applicationName });
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
protected onCloseRequest(msg: Message): void {
|
|
@@ -48,12 +50,12 @@ export class ModalNotification extends AbstractDialog<string | undefined> {
|
|
|
48
50
|
return this.actionTitle;
|
|
49
51
|
}
|
|
50
52
|
|
|
51
|
-
showDialog(messageType: MessageType, text: string, actions: MainMessageItem[]): Promise<string | undefined> {
|
|
52
|
-
this.contentNode.appendChild(this.createMessageNode(messageType, text, actions));
|
|
53
|
+
showDialog(messageType: MessageType, text: string, options: MainMessageOptions, actions: MainMessageItem[]): Promise<string | undefined> {
|
|
54
|
+
this.contentNode.appendChild(this.createMessageNode(messageType, text, options, actions));
|
|
53
55
|
return this.open();
|
|
54
56
|
}
|
|
55
57
|
|
|
56
|
-
protected createMessageNode(messageType: MessageType, text: string, actions: MainMessageItem[]): HTMLElement {
|
|
58
|
+
protected createMessageNode(messageType: MessageType, text: string, options: MainMessageOptions, actions: MainMessageItem[]): HTMLElement {
|
|
57
59
|
const messageNode = document.createElement('div');
|
|
58
60
|
messageNode.classList.add(NOTIFICATION);
|
|
59
61
|
|
|
@@ -67,6 +69,13 @@ export class ModalNotification extends AbstractDialog<string | undefined> {
|
|
|
67
69
|
const textElement = textContainer.appendChild(document.createElement('p'));
|
|
68
70
|
textElement.textContent = text;
|
|
69
71
|
|
|
72
|
+
if (options.detail) {
|
|
73
|
+
const detailContainer = textContainer.appendChild(document.createElement('div'));
|
|
74
|
+
detailContainer.classList.add(DETAIL);
|
|
75
|
+
const detailElement = detailContainer.appendChild(document.createElement('p'));
|
|
76
|
+
detailElement.textContent = options.detail;
|
|
77
|
+
}
|
|
78
|
+
|
|
70
79
|
actions.forEach((action: MainMessageItem) => {
|
|
71
80
|
const button = this.createButton(action.title);
|
|
72
81
|
button.classList.add('main');
|
|
@@ -79,8 +88,10 @@ export class ModalNotification extends AbstractDialog<string | undefined> {
|
|
|
79
88
|
},
|
|
80
89
|
'click');
|
|
81
90
|
});
|
|
82
|
-
if (
|
|
83
|
-
this.
|
|
91
|
+
if (actions.length <= 0) {
|
|
92
|
+
this.appendAcceptButton();
|
|
93
|
+
} else if (!actions.some(action => action.isCloseAffordance === true)) {
|
|
94
|
+
this.appendCloseButton('Close');
|
|
84
95
|
}
|
|
85
96
|
|
|
86
97
|
return messageNode;
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
order: 1;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
.modal-Notification .icon .
|
|
45
|
+
.modal-Notification .icon .codicon {
|
|
46
46
|
line-height: inherit;
|
|
47
47
|
vertical-align: middle;
|
|
48
|
-
font-size:
|
|
48
|
+
font-size: calc(var(--theia-ui-padding)*5);
|
|
49
49
|
color: var(--theia-editorInfo-foreground);
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -106,3 +106,18 @@
|
|
|
106
106
|
.modal-Notification .buttons > button:hover {
|
|
107
107
|
background-color: var(--theia-button-hoverBackground);
|
|
108
108
|
}
|
|
109
|
+
|
|
110
|
+
.modal-Notification .detail {
|
|
111
|
+
align-self: center;
|
|
112
|
+
order: 3;
|
|
113
|
+
flex: 1 100%;
|
|
114
|
+
color: var(--theia-descriptionForeground);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.modal-Notification .detail > p {
|
|
118
|
+
margin: calc(var(--theia-ui-padding) * 2) 0px 0px 0px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.modal-Notification .text {
|
|
122
|
+
padding: calc(var(--theia-ui-padding)*1.5);
|
|
123
|
+
}
|
|
@@ -29,8 +29,7 @@ import { EditorModelService } from './text-editor-model-service';
|
|
|
29
29
|
import { MonacoEditorModel } from '@theia/monaco/lib/browser/monaco-editor-model';
|
|
30
30
|
import { MonacoEditor } from '@theia/monaco/lib/browser/monaco-editor';
|
|
31
31
|
import { TextEditorMain } from './text-editor-main';
|
|
32
|
-
import { Emitter } from '@theia/core';
|
|
33
|
-
import { DisposableCollection } from '@theia/core';
|
|
32
|
+
import { DisposableCollection, Emitter } from '@theia/core';
|
|
34
33
|
import { EditorManager, EditorWidget } from '@theia/editor/lib/browser';
|
|
35
34
|
|
|
36
35
|
export class EditorsAndDocumentsMain implements Disposable {
|
|
@@ -774,7 +774,7 @@ export class LanguagesMainImpl implements LanguagesMain, Disposable {
|
|
|
774
774
|
selector: language,
|
|
775
775
|
getRootDefinition: (uri: DocumentUri, position: Position, cancellationToken: CancellationToken) =>
|
|
776
776
|
this.proxy.$provideRootDefinition(handle, toUriComponents(uri), fromPosition(position), cancellationToken)
|
|
777
|
-
.then(def => toDefinition(def)),
|
|
777
|
+
.then(def => Array.isArray(def) ? def.map(item => toDefinition(item)) : toDefinition(def)),
|
|
778
778
|
getCallers: (definition: Definition, cancellationToken: CancellationToken) => this.proxy.$provideCallers(handle, fromDefinition(definition), cancellationToken)
|
|
779
779
|
.then(result => {
|
|
780
780
|
if (!result) {
|
|
@@ -40,7 +40,7 @@ export class MessageRegistryMainImpl implements MessageRegistryMain {
|
|
|
40
40
|
type === MainMessageType.Warning ? MessageType.Warning :
|
|
41
41
|
MessageType.Info;
|
|
42
42
|
const modalNotification = new ModalNotification();
|
|
43
|
-
return modalNotification.showDialog(messageType, message, actions);
|
|
43
|
+
return modalNotification.showDialog(messageType, message, options, actions);
|
|
44
44
|
}
|
|
45
45
|
switch (type) {
|
|
46
46
|
case MainMessageType.Info:
|
|
@@ -194,7 +194,7 @@ export class QuickOpenMainImpl implements QuickOpenMain, Disposable {
|
|
|
194
194
|
|
|
195
195
|
private sessions = new Map<number, QuickInputSession>();
|
|
196
196
|
|
|
197
|
-
$createOrUpdate<T extends theia.QuickPickItem>(params: TransferQuickInput
|
|
197
|
+
$createOrUpdate<T extends theia.QuickPickItem>(params: TransferQuickInput): Promise<void> {
|
|
198
198
|
const sessionId = params.id;
|
|
199
199
|
let session = this.sessions.get(sessionId);
|
|
200
200
|
if (!session) {
|
|
@@ -14,12 +14,11 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { interfaces } from '@theia/core/shared/inversify';
|
|
17
|
-
import { TimelineMain } from '../../common/plugin-api-rpc';
|
|
17
|
+
import { MAIN_RPC_CONTEXT, TimelineExt, TimelineMain } from '../../common/plugin-api-rpc';
|
|
18
18
|
import { RPCProtocol } from '../../common/rpc-protocol';
|
|
19
19
|
import { TimelineService } from '@theia/timeline/lib/browser/timeline-service';
|
|
20
20
|
import { Emitter } from '@theia/core/lib/common';
|
|
21
21
|
import { URI } from '@theia/core/shared/vscode-uri';
|
|
22
|
-
import { MAIN_RPC_CONTEXT, TimelineExt } from '../../common/plugin-api-rpc';
|
|
23
22
|
import {
|
|
24
23
|
InternalTimelineOptions,
|
|
25
24
|
Timeline,
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
|
|
17
17
|
import { injectable, inject, postConstruct, optional } from '@theia/core/shared/inversify';
|
|
18
18
|
import {
|
|
19
|
-
ApplicationShell, ViewContainer as ViewContainerWidget, WidgetManager,
|
|
19
|
+
ApplicationShell, ViewContainer as ViewContainerWidget, WidgetManager, QuickViewService,
|
|
20
20
|
ViewContainerIdentifier, ViewContainerTitleOptions, Widget, FrontendApplicationContribution,
|
|
21
|
-
StatefulWidget, CommonMenus, BaseWidget, TreeViewWelcomeWidget, codicon
|
|
21
|
+
StatefulWidget, CommonMenus, BaseWidget, TreeViewWelcomeWidget, codicon, ViewContainerPart
|
|
22
22
|
} from '@theia/core/lib/browser';
|
|
23
23
|
import { ViewContainer, View, ViewWelcome } from '../../../common';
|
|
24
24
|
import { PluginSharedStyle } from '../plugin-shared-style';
|
|
@@ -31,16 +31,15 @@ import { DebugFrontendApplicationContribution } from '@theia/debug/lib/browser/d
|
|
|
31
31
|
import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposable';
|
|
32
32
|
import { CommandRegistry } from '@theia/core/lib/common/command';
|
|
33
33
|
import { MenuModelRegistry } from '@theia/core/lib/common/menu';
|
|
34
|
-
import { QuickViewService } from '@theia/core/lib/browser';
|
|
35
34
|
import { Emitter } from '@theia/core/lib/common/event';
|
|
36
35
|
import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
37
|
-
import { SearchInWorkspaceWidget } from '@theia/search-in-workspace/lib/browser/search-in-workspace-widget';
|
|
38
36
|
import { ViewContextKeyService } from './view-context-key-service';
|
|
39
37
|
import { PROBLEMS_WIDGET_ID } from '@theia/markers/lib/browser/problem/problem-widget';
|
|
40
38
|
import { OUTPUT_WIDGET_KIND } from '@theia/output/lib/browser/output-widget';
|
|
41
39
|
import { DebugConsoleContribution } from '@theia/debug/lib/browser/console/debug-console-contribution';
|
|
42
40
|
import { TERMINAL_WIDGET_FACTORY_ID } from '@theia/terminal/lib/browser/terminal-widget-impl';
|
|
43
41
|
import { TreeViewWidget } from './tree-view-widget';
|
|
42
|
+
import { SEARCH_VIEW_CONTAINER_ID } from '@theia/search-in-workspace/lib/browser/search-in-workspace-factory';
|
|
44
43
|
|
|
45
44
|
export const PLUGIN_VIEW_FACTORY_ID = 'plugin-view';
|
|
46
45
|
export const PLUGIN_VIEW_CONTAINER_FACTORY_ID = 'plugin-view-container';
|
|
@@ -100,8 +99,8 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
|
|
|
100
99
|
protected init(): void {
|
|
101
100
|
// VS Code Viewlets
|
|
102
101
|
this.trackVisibleWidget(EXPLORER_VIEW_CONTAINER_ID, { viewletId: 'workbench.view.explorer' });
|
|
103
|
-
this.trackVisibleWidget(SearchInWorkspaceWidget.ID, { viewletId: 'workbench.view.search', sideArea: true });
|
|
104
102
|
this.trackVisibleWidget(SCM_VIEW_CONTAINER_ID, { viewletId: 'workbench.view.scm' });
|
|
103
|
+
this.trackVisibleWidget(SEARCH_VIEW_CONTAINER_ID, { viewletId: 'workbench.view.search' });
|
|
105
104
|
this.trackVisibleWidget(DebugWidget.ID, { viewletId: 'workbench.view.debug' });
|
|
106
105
|
// TODO workbench.view.extensions - Theia does not have a proper extension view yet
|
|
107
106
|
|
|
@@ -111,7 +110,6 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
|
|
|
111
110
|
this.trackVisibleWidget(DebugConsoleContribution.options.id, { panelId: 'workbench.panel.repl' });
|
|
112
111
|
this.trackVisibleWidget(TERMINAL_WIDGET_FACTORY_ID, { panelId: 'workbench.panel.terminal' });
|
|
113
112
|
// TODO workbench.panel.comments - Theia does not have a proper comments view yet
|
|
114
|
-
this.trackVisibleWidget(SearchInWorkspaceWidget.ID, { panelId: 'workbench.view.search', sideArea: false });
|
|
115
113
|
|
|
116
114
|
this.updateFocusedView();
|
|
117
115
|
this.shell.onDidChangeActiveWidget(() => this.updateFocusedView());
|
|
@@ -123,6 +121,9 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
|
|
|
123
121
|
if (factoryId === SCM_VIEW_CONTAINER_ID && widget instanceof ViewContainerWidget) {
|
|
124
122
|
waitUntil(this.prepareViewContainer('scm', widget));
|
|
125
123
|
}
|
|
124
|
+
if (factoryId === SEARCH_VIEW_CONTAINER_ID && widget instanceof ViewContainerWidget) {
|
|
125
|
+
waitUntil(this.prepareViewContainer('search', widget));
|
|
126
|
+
}
|
|
126
127
|
if (factoryId === DebugWidget.ID && widget instanceof DebugWidget) {
|
|
127
128
|
const viewContainer = widget['sessionWidget']['viewContainer'];
|
|
128
129
|
waitUntil(this.prepareViewContainer('debug', viewContainer));
|
|
@@ -401,7 +402,9 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
|
|
|
401
402
|
return;
|
|
402
403
|
}
|
|
403
404
|
const [, view] = data;
|
|
404
|
-
widget.title.label
|
|
405
|
+
if (!widget.title.label) {
|
|
406
|
+
widget.title.label = view.name;
|
|
407
|
+
}
|
|
405
408
|
const currentDataWidget = widget.widgets[0];
|
|
406
409
|
const viewDataWidget = await this.createViewDataWidget(view.id);
|
|
407
410
|
if (widget.isDisposed) {
|
|
@@ -466,6 +469,14 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
|
|
|
466
469
|
}
|
|
467
470
|
for (const viewId of this.getContainerViews(viewContainerId)) {
|
|
468
471
|
const identifier = this.toPluginViewWidgetIdentifier(viewId);
|
|
472
|
+
// Keep existing widget in its current container and reregister its part to the plugin view widget events.
|
|
473
|
+
const existingWidget = this.widgetManager.tryGetWidget<PluginViewWidget>(PLUGIN_VIEW_FACTORY_ID, identifier);
|
|
474
|
+
if (existingWidget && existingWidget.currentViewContainerId) {
|
|
475
|
+
const currentContainer = await this.getPluginViewContainer(existingWidget.currentViewContainerId);
|
|
476
|
+
if (currentContainer && this.registerWidgetPartEvents(existingWidget, currentContainer)) {
|
|
477
|
+
continue;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
469
480
|
const widget = await this.widgetManager.getOrCreateWidget<PluginViewWidget>(PLUGIN_VIEW_FACTORY_ID, identifier);
|
|
470
481
|
if (containerWidget.getTrackableWidgets().indexOf(widget) === -1) {
|
|
471
482
|
containerWidget.addWidget(widget, {
|
|
@@ -473,27 +484,49 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
|
|
|
473
484
|
initiallyHidden: !this.isViewVisible(viewId)
|
|
474
485
|
});
|
|
475
486
|
}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
part.onDidChangeVisibility(() => widget.suppressUpdateViewVisibility = part.isHidden);
|
|
487
|
+
this.registerWidgetPartEvents(widget, containerWidget);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
480
490
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
491
|
+
protected registerWidgetPartEvents(widget: PluginViewWidget, containerWidget: ViewContainerWidget): ViewContainerPart | undefined {
|
|
492
|
+
const part = containerWidget.getPartFor(widget);
|
|
493
|
+
if (part) {
|
|
494
|
+
|
|
495
|
+
widget.currentViewContainerId = this.getViewContainerId(containerWidget);
|
|
496
|
+
part.onDidMove(event => { widget.currentViewContainerId = this.getViewContainerId(event); });
|
|
497
|
+
|
|
498
|
+
// if a view is explicitly hidden then suppress updating visibility based on `when` closure
|
|
499
|
+
part.onDidChangeVisibility(() => widget.suppressUpdateViewVisibility = part.isHidden);
|
|
500
|
+
|
|
501
|
+
const tryFireOnDidExpandView = () => {
|
|
502
|
+
if (widget.widgets.length === 0) {
|
|
503
|
+
if (!part.collapsed && part.isVisible) {
|
|
504
|
+
const viewId = this.toViewId(widget.options);
|
|
505
|
+
this.onDidExpandViewEmitter.fire(viewId);
|
|
488
506
|
}
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
507
|
+
} else {
|
|
508
|
+
toFire.dispose();
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
const toFire = new DisposableCollection(
|
|
512
|
+
part.onCollapsed(tryFireOnDidExpandView),
|
|
513
|
+
part.onDidChangeVisibility(tryFireOnDidExpandView)
|
|
514
|
+
);
|
|
494
515
|
|
|
495
|
-
|
|
496
|
-
|
|
516
|
+
tryFireOnDidExpandView();
|
|
517
|
+
return part;
|
|
518
|
+
}
|
|
519
|
+
};
|
|
520
|
+
|
|
521
|
+
protected getViewContainerId(container: ViewContainerWidget): string | undefined {
|
|
522
|
+
const description = this.widgetManager.getDescription(container);
|
|
523
|
+
switch (description?.factoryId) {
|
|
524
|
+
case EXPLORER_VIEW_CONTAINER_ID: return 'explorer';
|
|
525
|
+
case SCM_VIEW_CONTAINER_ID: return 'scm';
|
|
526
|
+
case SEARCH_VIEW_CONTAINER_ID: return 'search';
|
|
527
|
+
case undefined: return container.parent?.parent instanceof DebugWidget ? 'debug' : container.id;
|
|
528
|
+
case PLUGIN_VIEW_CONTAINER_FACTORY_ID: return this.toViewContainerId(description.options);
|
|
529
|
+
default: return container.id;
|
|
497
530
|
}
|
|
498
531
|
}
|
|
499
532
|
|
|
@@ -504,6 +537,9 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
|
|
|
504
537
|
if (viewContainerId === 'scm') {
|
|
505
538
|
return this.widgetManager.getWidget<ViewContainerWidget>(SCM_VIEW_CONTAINER_ID);
|
|
506
539
|
}
|
|
540
|
+
if (viewContainerId === 'search') {
|
|
541
|
+
return this.widgetManager.getWidget<ViewContainerWidget>(SEARCH_VIEW_CONTAINER_ID);
|
|
542
|
+
}
|
|
507
543
|
if (viewContainerId === 'debug') {
|
|
508
544
|
const debug = await this.widgetManager.getWidget(DebugWidget.ID);
|
|
509
545
|
if (debug instanceof DebugWidget) {
|
|
@@ -546,6 +582,12 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
|
|
|
546
582
|
await this.prepareViewContainer('scm', scm);
|
|
547
583
|
}
|
|
548
584
|
})().catch(console.error));
|
|
585
|
+
promises.push((async () => {
|
|
586
|
+
const search = await this.widgetManager.getWidget(SEARCH_VIEW_CONTAINER_ID);
|
|
587
|
+
if (search instanceof ViewContainerWidget) {
|
|
588
|
+
await this.prepareViewContainer('search', search);
|
|
589
|
+
}
|
|
590
|
+
})().catch(console.error));
|
|
549
591
|
promises.push((async () => {
|
|
550
592
|
const debug = await this.widgetManager.getWidget(DebugWidget.ID);
|
|
551
593
|
if (debug instanceof DebugWidget) {
|
|
@@ -46,6 +46,8 @@ export class PluginViewWidget extends Panel implements StatefulWidget, Descripti
|
|
|
46
46
|
@inject(PluginViewWidgetIdentifier)
|
|
47
47
|
readonly options: PluginViewWidgetIdentifier;
|
|
48
48
|
|
|
49
|
+
currentViewContainerId: string | undefined;
|
|
50
|
+
|
|
49
51
|
constructor() {
|
|
50
52
|
super();
|
|
51
53
|
this.node.tabIndex = -1;
|
|
@@ -75,7 +77,8 @@ export class PluginViewWidget extends Panel implements StatefulWidget, Descripti
|
|
|
75
77
|
label: this.title.label,
|
|
76
78
|
message: this.message,
|
|
77
79
|
widgets: this.widgets,
|
|
78
|
-
suppressUpdateViewVisibility: this._suppressUpdateViewVisibility
|
|
80
|
+
suppressUpdateViewVisibility: this._suppressUpdateViewVisibility,
|
|
81
|
+
currentViewContainerId: this.currentViewContainerId
|
|
79
82
|
};
|
|
80
83
|
}
|
|
81
84
|
|
|
@@ -83,6 +86,7 @@ export class PluginViewWidget extends Panel implements StatefulWidget, Descripti
|
|
|
83
86
|
this.title.label = state.label;
|
|
84
87
|
this.message = state.message;
|
|
85
88
|
this.suppressUpdateViewVisibility = state.suppressUpdateViewVisibility;
|
|
89
|
+
this.currentViewContainerId = state.currentViewContainerId;
|
|
86
90
|
for (const widget of state.widgets) {
|
|
87
91
|
this.addWidget(widget);
|
|
88
92
|
}
|
|
@@ -150,6 +154,7 @@ export namespace PluginViewWidget {
|
|
|
150
154
|
label: string,
|
|
151
155
|
message?: string,
|
|
152
156
|
widgets: ReadonlyArray<Widget>,
|
|
153
|
-
suppressUpdateViewVisibility: boolean
|
|
157
|
+
suppressUpdateViewVisibility: boolean;
|
|
158
|
+
currentViewContainerId: string | undefined;
|
|
154
159
|
}
|
|
155
160
|
}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { URI } from '@theia/core/shared/vscode-uri';
|
|
18
18
|
import { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
|
|
19
|
-
import { TreeViewsExt, TreeViewSelection } from '../../../common/plugin-api-rpc';
|
|
19
|
+
import { TreeViewsExt, TreeViewItemCollapsibleState, TreeViewItem, TreeViewSelection } from '../../../common/plugin-api-rpc';
|
|
20
20
|
import { Command } from '../../../common/plugin-api-rpc-model';
|
|
21
21
|
import {
|
|
22
22
|
TreeNode,
|
|
@@ -29,9 +29,10 @@ import {
|
|
|
29
29
|
TREE_NODE_SEGMENT_GROW_CLASS,
|
|
30
30
|
TREE_NODE_TAIL_CLASS,
|
|
31
31
|
TreeModelImpl,
|
|
32
|
-
TreeViewWelcomeWidget
|
|
32
|
+
TreeViewWelcomeWidget,
|
|
33
|
+
TooltipService,
|
|
34
|
+
TooltipAttributes
|
|
33
35
|
} from '@theia/core/lib/browser';
|
|
34
|
-
import { TreeViewItem, TreeViewItemCollapsibleState } from '../../../common/plugin-api-rpc';
|
|
35
36
|
import { MenuPath, MenuModelRegistry, ActionMenuNode } from '@theia/core/lib/common/menu';
|
|
36
37
|
import * as React from '@theia/core/shared/react';
|
|
37
38
|
import { PluginSharedStyle } from '../plugin-shared-style';
|
|
@@ -42,6 +43,8 @@ import { MessageService } from '@theia/core/lib/common/message-service';
|
|
|
42
43
|
import { View } from '../../../common/plugin-protocol';
|
|
43
44
|
import CoreURI from '@theia/core/lib/common/uri';
|
|
44
45
|
import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
46
|
+
import * as markdownit from 'markdown-it';
|
|
47
|
+
import { isMarkdownString } from '../../../plugin/markdown-string';
|
|
45
48
|
|
|
46
49
|
export const TREE_NODE_HYPERLINK = 'theia-TreeNodeHyperlink';
|
|
47
50
|
export const VIEW_ITEM_CONTEXT_MENU: MenuPath = ['view-item-context-menu'];
|
|
@@ -245,6 +248,9 @@ export class TreeViewWidget extends TreeViewWelcomeWidget {
|
|
|
245
248
|
@inject(ContextKeyService)
|
|
246
249
|
protected readonly contextKeyService: ContextKeyService;
|
|
247
250
|
|
|
251
|
+
@inject(TooltipService)
|
|
252
|
+
protected readonly tooltipService: TooltipService;
|
|
253
|
+
|
|
248
254
|
protected readonly onDidChangeVisibilityEmitter = new Emitter<boolean>();
|
|
249
255
|
readonly onDidChangeVisibility = this.onDidChangeVisibilityEmitter.event;
|
|
250
256
|
|
|
@@ -274,13 +280,32 @@ export class TreeViewWidget extends TreeViewWelcomeWidget {
|
|
|
274
280
|
classes.push(TREE_NODE_SEGMENT_GROW_CLASS);
|
|
275
281
|
}
|
|
276
282
|
const className = classes.join(' ');
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
283
|
+
|
|
284
|
+
let attrs: React.HTMLAttributes<HTMLElement> & Partial<TooltipAttributes> = {
|
|
285
|
+
...this.decorateCaption(node, {}),
|
|
286
|
+
className,
|
|
287
|
+
id: node.id
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
if (node.tooltip && isMarkdownString(node.tooltip)) {
|
|
291
|
+
// Render markdown in custom tooltip
|
|
292
|
+
const tooltip = markdownit().render(node.tooltip.value);
|
|
293
|
+
|
|
294
|
+
attrs = {
|
|
295
|
+
...attrs,
|
|
296
|
+
'data-tip': tooltip,
|
|
297
|
+
'data-for': this.tooltipService.tooltipId
|
|
298
|
+
};
|
|
299
|
+
} else {
|
|
300
|
+
const title = node.tooltip ||
|
|
301
|
+
(node.resourceUri && this.labelProvider.getLongName(new CoreURI(node.resourceUri)))
|
|
302
|
+
|| this.toNodeName(node);
|
|
303
|
+
|
|
304
|
+
attrs = {
|
|
305
|
+
...attrs,
|
|
306
|
+
title
|
|
307
|
+
};
|
|
308
|
+
}
|
|
284
309
|
|
|
285
310
|
const children: React.ReactNode[] = [];
|
|
286
311
|
const caption = this.toNodeName(node);
|
|
@@ -294,43 +319,11 @@ export class TreeViewWidget extends TreeViewWelcomeWidget {
|
|
|
294
319
|
} else if (!highlight) {
|
|
295
320
|
children.push(caption);
|
|
296
321
|
}
|
|
297
|
-
return React.createElement('div', attrs, ...children);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
protected getCaption(node: TreeNode): React.ReactNode {
|
|
301
|
-
const nodes: React.ReactNode[] = [];
|
|
302
|
-
|
|
303
|
-
const name = this.toNodeName(node) || '';
|
|
304
322
|
const description = this.toNodeDescription(node);
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
const regex = /\[([^\[]+)\]\(([^\)]+)\)/g;
|
|
309
|
-
const matchResult = work.match(regex);
|
|
310
|
-
|
|
311
|
-
if (matchResult) {
|
|
312
|
-
matchResult.forEach((match, index) => {
|
|
313
|
-
nodes.push(<span key={`m${index}`}>{work.substring(0, work.indexOf(match))}</span>);
|
|
314
|
-
|
|
315
|
-
const execResult = regex.exec(name);
|
|
316
|
-
nodes.push(<a key={`l${index}`}
|
|
317
|
-
href={execResult![2]}
|
|
318
|
-
target='_blank'
|
|
319
|
-
className={TREE_NODE_HYPERLINK}
|
|
320
|
-
onClick={e => e.stopPropagation()}>{execResult![1]}</a>
|
|
321
|
-
);
|
|
322
|
-
|
|
323
|
-
work = work.substring(work.indexOf(match) + match.length);
|
|
324
|
-
});
|
|
323
|
+
if (description) {
|
|
324
|
+
children.push(<span className='theia-tree-view-description'>{description}</span>);
|
|
325
325
|
}
|
|
326
|
-
|
|
327
|
-
return <div className='noWrapInfoTree'>
|
|
328
|
-
{...nodes}
|
|
329
|
-
{work && <span>{work}</span>}
|
|
330
|
-
{description && <span className='theia-tree-view-description'>
|
|
331
|
-
{description}
|
|
332
|
-
</span>}
|
|
333
|
-
</div>;
|
|
326
|
+
return React.createElement('div', attrs, ...children);
|
|
334
327
|
}
|
|
335
328
|
|
|
336
329
|
protected renderTailDecorations(node: TreeViewNode, props: NodeProps): React.ReactNode {
|
|
@@ -444,7 +437,9 @@ export class TreeViewWidget extends TreeViewWelcomeWidget {
|
|
|
444
437
|
}
|
|
445
438
|
|
|
446
439
|
protected render(): React.ReactNode {
|
|
447
|
-
|
|
440
|
+
const node = React.createElement('div', this.createContainerAttributes(), this.renderSearchInfo(), this.renderTree(this.model));
|
|
441
|
+
this.tooltipService.update();
|
|
442
|
+
return node;
|
|
448
443
|
}
|
|
449
444
|
|
|
450
445
|
protected renderSearchInfo(): React.ReactNode {
|
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
constructor() {
|
|
27
27
|
this.handlers = new Map();
|
|
28
28
|
window.addEventListener('message', e => {
|
|
29
|
+
// Note: `window.parent === window` when there is no parent...
|
|
30
|
+
const sourceIsSelfOrParentFrame = e.source === window.parent;
|
|
29
31
|
let sourceIsChildFrame = false;
|
|
30
32
|
for (let i = 0; i < window.frames.length; i++) {
|
|
31
33
|
const frame = window.frames[i];
|
|
@@ -35,11 +37,8 @@
|
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
if (sourceIsChildFrame && e.data && (e.data.command === 'onmessage' || e.data.command === 'do-update-state')) {
|
|
38
|
-
// Came from inner iframe
|
|
39
40
|
this.postMessage(e.data.command, e.data.data);
|
|
40
|
-
}
|
|
41
|
-
// Note: `window.parent === window` when there is no parent...
|
|
42
|
-
if (sourceIsChildFrame || e.source === window.parent) {
|
|
41
|
+
} else if (sourceIsChildFrame || sourceIsSelfOrParentFrame) {
|
|
43
42
|
const channel = e.data.channel;
|
|
44
43
|
const handler = this.handlers.get(channel);
|
|
45
44
|
if (handler) {
|
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
17
|
import { MessageService } from '@theia/core';
|
|
18
|
-
import { FrontendApplicationContribution } from '@theia/core/lib/browser';
|
|
18
|
+
import { Dialog, FrontendApplicationContribution } from '@theia/core/lib/browser';
|
|
19
19
|
import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider';
|
|
20
|
+
import { nls } from '@theia/core/lib/common/nls';
|
|
20
21
|
import { WindowService } from '@theia/core/lib/browser/window/window-service';
|
|
21
22
|
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
22
23
|
import { WebviewExternalEndpoint } from '../../common/webview-protocol';
|
|
@@ -44,12 +45,12 @@ export class WebviewFrontendSecurityWarnings implements FrontendApplicationContr
|
|
|
44
45
|
}
|
|
45
46
|
const hostPattern = await this.webviewEnvironment.hostPatternPromise;
|
|
46
47
|
if (hostPattern !== WebviewExternalEndpoint.defaultPattern) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
).then(action => {
|
|
52
|
-
if (action ===
|
|
48
|
+
const goToReadme = nls.localize('theia/webview/goToReadme', 'Go To README');
|
|
49
|
+
const message = nls.localize('theia/webview/messageWarning', '\
|
|
50
|
+
The {0} endpoint\'s host pattern has been changed to `{1}`; changing the pattern can lead to security vulnerabilities. \
|
|
51
|
+
See `{2}` for more information.', 'webview', hostPattern, '@theia/plugin-ext/README.md');
|
|
52
|
+
this.messageService.warn(message, Dialog.OK, goToReadme).then(action => {
|
|
53
|
+
if (action === goToReadme) {
|
|
53
54
|
this.windowService.openNewWindow('https://www.npmjs.com/package/@theia/plugin-ext', { external: true });
|
|
54
55
|
}
|
|
55
56
|
});
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
PreferenceContribution,
|
|
24
24
|
PreferenceSchema
|
|
25
25
|
} from '@theia/core/lib/browser/preferences';
|
|
26
|
+
import { nls } from '@theia/core/lib/common/nls';
|
|
26
27
|
|
|
27
28
|
const frontendConfig = FrontendApplicationConfigProvider.get();
|
|
28
29
|
|
|
@@ -32,7 +33,7 @@ export const WebviewConfigSchema: PreferenceSchema = {
|
|
|
32
33
|
'webview.trace': {
|
|
33
34
|
type: 'string',
|
|
34
35
|
enum: ['off', 'on', 'verbose'],
|
|
35
|
-
description: 'Controls communication tracing with webviews.',
|
|
36
|
+
description: nls.localize('theia/plugin-ext/webviewTrace', 'Controls communication tracing with webviews.'),
|
|
36
37
|
default: 'off'
|
|
37
38
|
}
|
|
38
39
|
}
|
|
@@ -42,7 +43,7 @@ if (frontendConfig.securityWarnings) {
|
|
|
42
43
|
WebviewConfigSchema.properties['webview.warnIfUnsecure'] = {
|
|
43
44
|
scope: 'application',
|
|
44
45
|
type: 'boolean',
|
|
45
|
-
description: 'Warns users that webviews are currently deployed unsecurely.',
|
|
46
|
+
description: nls.localize('theia/plugin-ext/webviewWarnIfUnsecure', 'Warns users that webviews are currently deployed unsecurely.'),
|
|
46
47
|
default: true,
|
|
47
48
|
};
|
|
48
49
|
}
|
|
@@ -40,7 +40,7 @@ import { Schemes } from '../../../common/uri-components';
|
|
|
40
40
|
import { PluginSharedStyle } from '../plugin-shared-style';
|
|
41
41
|
import { WebviewThemeDataProvider } from './webview-theme-data-provider';
|
|
42
42
|
import { ExternalUriService } from '@theia/core/lib/browser/external-uri-service';
|
|
43
|
-
import { OutputChannelManager } from '@theia/output/lib/
|
|
43
|
+
import { OutputChannelManager } from '@theia/output/lib/browser/output-channel';
|
|
44
44
|
import { WebviewPreferences } from './webview-preferences';
|
|
45
45
|
import { WebviewResourceCache } from './webview-resource-cache';
|
|
46
46
|
import { Endpoint } from '@theia/core/lib/browser/endpoint';
|