@theia/plugin-ext 1.18.0 → 1.21.0-next.12
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 +47 -34
- package/lib/common/connection.d.ts.map +1 -1
- package/lib/common/connection.js +90 -28
- 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 +10 -11
- 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 +3 -1
- 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 +18 -14
- 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 +1 -1
- package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.js +5 -1
- 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.d.ts +3 -3
- package/lib/main/browser/debug/debug-main.d.ts.map +1 -1
- package/lib/main/browser/debug/debug-main.js +2 -3
- package/lib/main/browser/debug/debug-main.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-factory.d.ts +6 -6
- package/lib/main/browser/debug/plugin-debug-session-factory.d.ts.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-factory.js +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/file-system-main-impl.js +1 -1
- package/lib/main/browser/file-system-main-impl.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/main-context.js +2 -2
- package/lib/main/browser/main-context.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/tasks-main.d.ts.map +1 -1
- package/lib/main/browser/tasks-main.js +6 -0
- package/lib/main/browser/tasks-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 +77 -26
- 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 -7
- package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
- package/lib/main/browser/view/tree-view-widget.js +26 -39
- 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 +3 -0
- package/lib/plugin/message-registry.js.map +1 -1
- package/lib/plugin/node/debug/debug.d.ts +4 -4
- package/lib/plugin/node/debug/debug.d.ts.map +1 -1
- package/lib/plugin/node/debug/debug.js +13 -8
- package/lib/plugin/node/debug/debug.js.map +1 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-session.d.ts +7 -7
- package/lib/plugin/node/debug/plugin-debug-adapter-session.d.ts.map +1 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-session.js +6 -6
- package/lib/plugin/node/debug/plugin-debug-adapter-session.js.map +1 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-starter.d.ts +8 -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 +16 -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 +5 -4
- 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 +1 -1
- package/lib/plugin/quick-open.d.ts.map +1 -1
- package/lib/plugin/quick-open.js +11 -6
- package/lib/plugin/quick-open.js.map +1 -1
- package/lib/plugin/tasks/tasks.d.ts +1 -3
- package/lib/plugin/tasks/tasks.d.ts.map +1 -1
- package/lib/plugin/tasks/tasks.js +3 -17
- package/lib/plugin/tasks/tasks.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 +98 -42
- package/src/common/plugin-api-rpc-model.ts +2 -0
- package/src/common/plugin-api-rpc.ts +10 -11
- package/src/common/plugin-protocol.ts +3 -2
- package/src/hosted/browser/hosted-plugin.ts +17 -12
- 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 +6 -3
- 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 +4 -5
- package/src/main/browser/debug/plugin-debug-session-factory.ts +6 -6
- 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/file-system-main-impl.ts +1 -1
- package/src/main/browser/languages-main.ts +1 -1
- package/src/main/browser/main-context.ts +3 -3
- package/src/main/browser/message-registry-main.ts +1 -1
- package/src/main/browser/quick-open-main.ts +1 -1
- package/src/main/browser/style/tree.css +4 -0
- package/src/main/browser/tasks-main.ts +7 -0
- package/src/main/browser/timeline-main.ts +1 -2
- package/src/main/browser/view/plugin-view-registry.ts +83 -28
- package/src/main/browser/view/plugin-view-widget.ts +7 -2
- package/src/main/browser/view/tree-view-widget.tsx +43 -65
- 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 +3 -1
- package/src/plugin/node/debug/debug.ts +20 -14
- package/src/plugin/node/debug/plugin-debug-adapter-session.ts +9 -9
- package/src/plugin/node/debug/plugin-debug-adapter-starter.ts +17 -14
- package/src/plugin/plugin-context.ts +10 -7
- package/src/plugin/plugin-storage.ts +1 -2
- package/src/plugin/preference-registry.spec.ts +1 -2
- package/src/plugin/quick-open.ts +14 -10
- package/src/plugin/tasks/tasks.ts +4 -18
- 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
- package/lib/common/plugin-message-reader.d.ts +0 -46
- package/lib/common/plugin-message-reader.d.ts.map +0 -1
- package/lib/common/plugin-message-reader.js +0 -116
- package/lib/common/plugin-message-reader.js.map +0 -1
- package/lib/common/plugin-message-writer.d.ts +0 -38
- package/lib/common/plugin-message-writer.d.ts.map +0 -1
- package/lib/common/plugin-message-writer.js +0 -67
- package/lib/common/plugin-message-writer.js.map +0 -1
- package/lib/main/browser/connection-main.d.ts +0 -59
- package/lib/main/browser/connection-main.d.ts.map +0 -1
- package/lib/main/browser/connection-main.js +0 -98
- package/lib/main/browser/connection-main.js.map +0 -1
- package/lib/plugin/connection-ext.d.ts +0 -56
- package/lib/plugin/connection-ext.d.ts.map +0 -1
- package/lib/plugin/connection-ext.js +0 -88
- package/lib/plugin/connection-ext.js.map +0 -1
- package/src/common/plugin-message-reader.ts +0 -111
- package/src/common/plugin-message-writer.ts +0 -65
- package/src/main/browser/connection-main.ts +0 -107
- package/src/plugin/connection-ext.ts +0 -95
|
@@ -29,7 +29,9 @@ export class CallHierarchyAdapter {
|
|
|
29
29
|
private readonly documents: DocumentsExtImpl
|
|
30
30
|
) { }
|
|
31
31
|
|
|
32
|
-
async provideRootDefinition(
|
|
32
|
+
async provideRootDefinition(
|
|
33
|
+
resource: URI, position: rpc.Position, token: theia.CancellationToken
|
|
34
|
+
): Promise<model.CallHierarchyDefinition | model.CallHierarchyDefinition[] | undefined> {
|
|
33
35
|
const documentData = this.documents.getDocumentData(resource);
|
|
34
36
|
if (!documentData) {
|
|
35
37
|
return Promise.reject(new Error(`There is no document for ${resource}`));
|
|
@@ -40,12 +42,14 @@ export class CallHierarchyAdapter {
|
|
|
40
42
|
position.lineNumber,
|
|
41
43
|
position.column
|
|
42
44
|
),
|
|
43
|
-
token
|
|
45
|
+
token
|
|
46
|
+
);
|
|
47
|
+
|
|
44
48
|
if (!definition) {
|
|
45
49
|
return undefined;
|
|
46
50
|
}
|
|
47
51
|
|
|
48
|
-
return this.fromCallHierarchyItem(definition);
|
|
52
|
+
return Array.isArray(definition) ? definition.map(item => this.fromCallHierarchyItem(item)) : this.fromCallHierarchyItem(definition);
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
async provideCallers(definition: model.CallHierarchyDefinition, token: theia.CancellationToken): Promise<model.CallHierarchyReference[] | undefined> {
|
|
@@ -73,7 +77,8 @@ export class CallHierarchyAdapter {
|
|
|
73
77
|
selectionRange: this.fromRange(item.selectionRange),
|
|
74
78
|
name: item.name,
|
|
75
79
|
kind: item.kind,
|
|
76
|
-
tags: item.tags
|
|
80
|
+
tags: item.tags,
|
|
81
|
+
data: item.data,
|
|
77
82
|
};
|
|
78
83
|
}
|
|
79
84
|
|
|
@@ -96,7 +101,7 @@ export class CallHierarchyAdapter {
|
|
|
96
101
|
}
|
|
97
102
|
|
|
98
103
|
private toCallHierarchyItem(definition: model.CallHierarchyDefinition): theia.CallHierarchyItem {
|
|
99
|
-
|
|
104
|
+
const item = new types.CallHierarchyItem(
|
|
100
105
|
Converter.SymbolKind.toSymbolKind(definition.kind),
|
|
101
106
|
definition.name,
|
|
102
107
|
definition.detail ? definition.detail : '',
|
|
@@ -104,6 +109,9 @@ export class CallHierarchyAdapter {
|
|
|
104
109
|
this.toRange(definition.range),
|
|
105
110
|
this.toRange(definition.selectionRange),
|
|
106
111
|
);
|
|
112
|
+
item.tags = definition.tags;
|
|
113
|
+
item.data = definition.data;
|
|
114
|
+
return item;
|
|
107
115
|
}
|
|
108
116
|
|
|
109
117
|
private fromCallHierarchyIncomingCall(caller: theia.CallHierarchyIncomingCall): model.CallHierarchyReference {
|
|
@@ -19,8 +19,7 @@ import * as theia from '@theia/plugin';
|
|
|
19
19
|
import * as Converter from '../type-converters';
|
|
20
20
|
import * as model from '../../common/plugin-api-rpc-model';
|
|
21
21
|
import { DocumentsExtImpl } from '../documents';
|
|
22
|
-
import { WorkspaceEditDto } from '../../common/plugin-api-rpc';
|
|
23
|
-
import { Position } from '../../common/plugin-api-rpc';
|
|
22
|
+
import { Position, WorkspaceEditDto } from '../../common/plugin-api-rpc';
|
|
24
23
|
import { Range } from '../types-impl';
|
|
25
24
|
import { isObject } from '../../common/types';
|
|
26
25
|
|
package/src/plugin/languages.ts
CHANGED
|
@@ -583,7 +583,9 @@ export class LanguagesExtImpl implements LanguagesExt {
|
|
|
583
583
|
return this.createDisposable(callId);
|
|
584
584
|
}
|
|
585
585
|
|
|
586
|
-
$provideRootDefinition(
|
|
586
|
+
$provideRootDefinition(
|
|
587
|
+
handle: number, resource: UriComponents, location: Position, token: theia.CancellationToken
|
|
588
|
+
): Promise<CallHierarchyDefinition | CallHierarchyDefinition[] | undefined> {
|
|
587
589
|
return this.withAdapter(handle, CallHierarchyAdapter, adapter => adapter.provideRootDefinition(URI.revive(resource), location, token), undefined);
|
|
588
590
|
}
|
|
589
591
|
|
|
@@ -50,6 +50,9 @@ export class MessageRegistryExt {
|
|
|
50
50
|
} else {
|
|
51
51
|
if ('modal' in optionsOrFirstItem) {
|
|
52
52
|
options.modal = optionsOrFirstItem.modal;
|
|
53
|
+
if ('detail' in optionsOrFirstItem) {
|
|
54
|
+
options.detail = optionsOrFirstItem.detail;
|
|
55
|
+
}
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
58
|
}
|
|
@@ -59,5 +62,4 @@ export class MessageRegistryExt {
|
|
|
59
62
|
const actionHandle = await this.proxy.$showMessage(type, message, options, actions);
|
|
60
63
|
return actionHandle !== undefined ? items[actionHandle] : undefined;
|
|
61
64
|
}
|
|
62
|
-
|
|
63
65
|
}
|
|
@@ -15,22 +15,24 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { Emitter } from '@theia/core/lib/common/event';
|
|
17
17
|
import { Path } from '@theia/core/lib/common/path';
|
|
18
|
-
import { CommunicationProvider } from '@theia/debug/lib/common/debug-model';
|
|
19
18
|
import * as theia from '@theia/plugin';
|
|
20
19
|
import { URI } from '@theia/core/shared/vscode-uri';
|
|
21
20
|
import { Breakpoint } from '../../../common/plugin-api-rpc-model';
|
|
22
21
|
import { DebugConfigurationProviderTriggerKind, DebugExt, DebugMain, PLUGIN_RPC_CONTEXT as Ext, TerminalOptionsExt } from '../../../common/plugin-api-rpc';
|
|
23
22
|
import { PluginPackageDebuggersContribution } from '../../../common/plugin-protocol';
|
|
24
23
|
import { RPCProtocol } from '../../../common/rpc-protocol';
|
|
25
|
-
import { PluginWebSocketChannel } from '../../../common/connection';
|
|
26
24
|
import { CommandRegistryImpl } from '../../command-registry';
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
25
|
+
import { ConnectionImpl } from '../../../common/connection';
|
|
26
|
+
import {
|
|
27
|
+
Disposable, Breakpoint as BreakpointExt, SourceBreakpoint, FunctionBreakpoint, Location, Range,
|
|
28
|
+
DebugAdapterServer, DebugAdapterExecutable, DebugAdapterNamedPipeServer, DebugAdapterInlineImplementation
|
|
29
|
+
} from '../../types-impl';
|
|
29
30
|
import { resolveDebugAdapterExecutable } from './plugin-debug-adapter-executable-resolver';
|
|
30
31
|
import { PluginDebugAdapterSession } from './plugin-debug-adapter-session';
|
|
31
|
-
import {
|
|
32
|
+
import { connectInlineDebugAdapter, connectPipeDebugAdapter, connectSocketDebugAdapter, startDebugAdapter } from './plugin-debug-adapter-starter';
|
|
32
33
|
import { PluginDebugAdapterTracker } from './plugin-debug-adapter-tracker';
|
|
33
34
|
import uuid = require('uuid');
|
|
35
|
+
import { DebugAdapter } from '@theia/debug/lib/node/debug-model';
|
|
34
36
|
|
|
35
37
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
36
38
|
|
|
@@ -57,7 +59,7 @@ export class DebugExtImpl implements DebugExt {
|
|
|
57
59
|
private trackerFactories: [string, theia.DebugAdapterTrackerFactory][] = [];
|
|
58
60
|
private contributionPaths = new Map<string, string>();
|
|
59
61
|
|
|
60
|
-
private connectionExt:
|
|
62
|
+
private connectionExt: ConnectionImpl;
|
|
61
63
|
private commandRegistryExt: CommandRegistryImpl;
|
|
62
64
|
|
|
63
65
|
private proxy: DebugMain;
|
|
@@ -88,7 +90,7 @@ export class DebugExtImpl implements DebugExt {
|
|
|
88
90
|
/**
|
|
89
91
|
* Sets dependencies.
|
|
90
92
|
*/
|
|
91
|
-
assistedInject(connectionExt:
|
|
93
|
+
assistedInject(connectionExt: ConnectionImpl, commandRegistryExt: CommandRegistryImpl): void {
|
|
92
94
|
this.connectionExt = connectionExt;
|
|
93
95
|
this.commandRegistryExt = commandRegistryExt;
|
|
94
96
|
}
|
|
@@ -298,13 +300,13 @@ export class DebugExtImpl implements DebugExt {
|
|
|
298
300
|
};
|
|
299
301
|
|
|
300
302
|
const tracker = await this.createDebugAdapterTracker(theiaSession);
|
|
301
|
-
const communicationProvider = await this.
|
|
303
|
+
const communicationProvider = await this.createDebugAdapter(theiaSession, debugConfiguration);
|
|
302
304
|
|
|
303
305
|
const debugAdapterSession = new PluginDebugAdapterSession(communicationProvider, tracker, theiaSession);
|
|
304
306
|
this.sessions.set(sessionId, debugAdapterSession);
|
|
305
307
|
|
|
306
308
|
const connection = await this.connectionExt!.ensureConnection(sessionId);
|
|
307
|
-
debugAdapterSession.start(
|
|
309
|
+
debugAdapterSession.start(connection);
|
|
308
310
|
|
|
309
311
|
return sessionId;
|
|
310
312
|
}
|
|
@@ -403,7 +405,7 @@ export class DebugExtImpl implements DebugExt {
|
|
|
403
405
|
return PluginDebugAdapterTracker.create(session, this.trackerFactories);
|
|
404
406
|
}
|
|
405
407
|
|
|
406
|
-
protected async
|
|
408
|
+
protected async createDebugAdapter(session: theia.DebugSession, debugConfiguration: theia.DebugConfiguration): Promise<DebugAdapter> {
|
|
407
409
|
const executable = await this.resolveDebugAdapterExecutable(debugConfiguration);
|
|
408
410
|
const descriptorFactory = this.descriptorFactories.get(session.type);
|
|
409
411
|
if (descriptorFactory) {
|
|
@@ -423,16 +425,20 @@ export class DebugExtImpl implements DebugExt {
|
|
|
423
425
|
// @param executable The debug adapter's executable information as specified in the package.json (or undefined if no such information exists).
|
|
424
426
|
const descriptor = await descriptorFactory.createDebugAdapterDescriptor(session, executable);
|
|
425
427
|
if (descriptor) {
|
|
426
|
-
if (
|
|
427
|
-
return
|
|
428
|
-
} else {
|
|
428
|
+
if (DebugAdapterServer.is(descriptor)) {
|
|
429
|
+
return connectSocketDebugAdapter(descriptor);
|
|
430
|
+
} else if (DebugAdapterExecutable.is(descriptor)) {
|
|
429
431
|
return startDebugAdapter(descriptor);
|
|
432
|
+
} else if (DebugAdapterNamedPipeServer.is(descriptor)) {
|
|
433
|
+
return connectPipeDebugAdapter(descriptor);
|
|
434
|
+
} else if (DebugAdapterInlineImplementation.is(descriptor)) {
|
|
435
|
+
return connectInlineDebugAdapter(descriptor);
|
|
430
436
|
}
|
|
431
437
|
}
|
|
432
438
|
}
|
|
433
439
|
|
|
434
440
|
if ('debugServer' in debugConfiguration) {
|
|
435
|
-
return
|
|
441
|
+
return connectSocketDebugAdapter({ port: debugConfiguration.debugServer });
|
|
436
442
|
} else {
|
|
437
443
|
if (!executable) {
|
|
438
444
|
throw new Error('It is not possible to provide debug adapter executable.');
|
|
@@ -14,34 +14,34 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import { CommunicationProvider } from '@theia/debug/lib/common/debug-model';
|
|
18
17
|
import { DebugAdapterSessionImpl } from '@theia/debug/lib/node/debug-adapter-session';
|
|
19
18
|
import * as theia from '@theia/plugin';
|
|
20
|
-
import {
|
|
19
|
+
import { DebugAdapter } from '@theia/debug/lib/node/debug-model';
|
|
20
|
+
import { Channel } from '@theia/debug/lib/common/debug-service';
|
|
21
21
|
|
|
22
22
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Server debug adapter session.
|
|
26
26
|
*/
|
|
27
|
-
export class PluginDebugAdapterSession extends DebugAdapterSessionImpl
|
|
27
|
+
export class PluginDebugAdapterSession extends DebugAdapterSessionImpl {
|
|
28
28
|
readonly type: string;
|
|
29
29
|
readonly name: string;
|
|
30
30
|
readonly configuration: theia.DebugConfiguration;
|
|
31
31
|
|
|
32
32
|
constructor(
|
|
33
|
-
|
|
33
|
+
readonly debugAdapter: DebugAdapter,
|
|
34
34
|
protected readonly tracker: theia.DebugAdapterTracker,
|
|
35
35
|
protected readonly theiaSession: theia.DebugSession) {
|
|
36
36
|
|
|
37
|
-
super(theiaSession.id,
|
|
37
|
+
super(theiaSession.id, debugAdapter);
|
|
38
38
|
|
|
39
39
|
this.type = theiaSession.type;
|
|
40
40
|
this.name = theiaSession.name;
|
|
41
41
|
this.configuration = theiaSession.configuration;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
async start(channel:
|
|
44
|
+
async start(channel: Channel): Promise<void> {
|
|
45
45
|
if (this.tracker.onWillStartSession) {
|
|
46
46
|
this.tracker.onWillStartSession();
|
|
47
47
|
}
|
|
@@ -83,10 +83,10 @@ export class PluginDebugAdapterSession extends DebugAdapterSessionImpl implement
|
|
|
83
83
|
super.write(message);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
protected onDebugAdapterExit(
|
|
86
|
+
protected onDebugAdapterExit(): void {
|
|
87
87
|
if (this.tracker.onExit) {
|
|
88
|
-
this.tracker.onExit(
|
|
88
|
+
this.tracker.onExit(undefined, undefined);
|
|
89
89
|
}
|
|
90
|
-
super.onDebugAdapterExit(
|
|
90
|
+
super.onDebugAdapterExit();
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -15,15 +15,17 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
17
|
import * as net from 'net';
|
|
18
|
-
import * as theia from '@theia/plugin';
|
|
19
|
-
import { CommunicationProvider } from '@theia/debug/lib/common/debug-model';
|
|
20
18
|
import { ChildProcess, spawn, fork, ForkOptions } from 'child_process';
|
|
19
|
+
import { DebugAdapter } from '@theia/debug/lib/node/debug-model';
|
|
20
|
+
import { DebugAdapterExecutable, DebugAdapterInlineImplementation, DebugAdapterNamedPipeServer, DebugAdapterServer } from '../../types-impl';
|
|
21
|
+
import { InlineDebugAdapter } from '@theia/debug/lib/node/inline-debug-adapter';
|
|
22
|
+
import { ProcessDebugAdapter, SocketDebugAdapter } from '@theia/debug/lib/node/stream-debug-adapter';
|
|
21
23
|
const isElectron = require('is-electron');
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
26
|
* Starts debug adapter process.
|
|
25
27
|
*/
|
|
26
|
-
export function startDebugAdapter(executable:
|
|
28
|
+
export function startDebugAdapter(executable: DebugAdapterExecutable): DebugAdapter {
|
|
27
29
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
30
|
const options: any = { stdio: ['pipe', 'pipe', 2] };
|
|
29
31
|
|
|
@@ -63,21 +65,22 @@ export function startDebugAdapter(executable: theia.DebugAdapterExecutable): Com
|
|
|
63
65
|
childProcess = spawn(command, args, options);
|
|
64
66
|
}
|
|
65
67
|
|
|
66
|
-
return
|
|
67
|
-
input: childProcess.stdin!,
|
|
68
|
-
output: childProcess.stdout!,
|
|
69
|
-
dispose: () => childProcess.kill()
|
|
70
|
-
};
|
|
68
|
+
return new ProcessDebugAdapter(childProcess);
|
|
71
69
|
}
|
|
72
70
|
|
|
73
71
|
/**
|
|
74
72
|
* Connects to a remote debug server.
|
|
75
73
|
*/
|
|
76
|
-
export function
|
|
74
|
+
export function connectSocketDebugAdapter(server: DebugAdapterServer): SocketDebugAdapter {
|
|
77
75
|
const socket = net.createConnection(server.port, server.host);
|
|
78
|
-
return
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
return new SocketDebugAdapter(socket);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function connectPipeDebugAdapter(adapter: DebugAdapterNamedPipeServer): SocketDebugAdapter {
|
|
80
|
+
const socket = net.createConnection(adapter.path);
|
|
81
|
+
return new SocketDebugAdapter(socket);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function connectInlineDebugAdapter(adapter: DebugAdapterInlineImplementation): InlineDebugAdapter {
|
|
85
|
+
return new InlineDebugAdapter(adapter.implementation);
|
|
83
86
|
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
import type * as theia from '@theia/plugin';
|
|
21
21
|
import { CommandRegistryImpl } from './command-registry';
|
|
22
22
|
import { Emitter } from '@theia/core/lib/common/event';
|
|
23
|
-
import { CancellationTokenSource } from '@theia/core/lib/common/cancellation';
|
|
23
|
+
import { CancellationError, CancellationToken, CancellationTokenSource } from '@theia/core/lib/common/cancellation';
|
|
24
24
|
import { QuickOpenExtImpl } from './quick-open';
|
|
25
25
|
import {
|
|
26
26
|
MAIN_RPC_CONTEXT,
|
|
@@ -28,7 +28,8 @@ import {
|
|
|
28
28
|
PluginManager,
|
|
29
29
|
PluginAPIFactory,
|
|
30
30
|
MainMessageType,
|
|
31
|
-
DebugConfigurationProviderTriggerKind
|
|
31
|
+
DebugConfigurationProviderTriggerKind,
|
|
32
|
+
PLUGIN_RPC_CONTEXT
|
|
32
33
|
} from '../common/plugin-api-rpc';
|
|
33
34
|
import { RPCProtocol } from '../common/rpc-protocol';
|
|
34
35
|
import { MessageRegistryExt } from './message-registry';
|
|
@@ -106,6 +107,8 @@ import {
|
|
|
106
107
|
Task2,
|
|
107
108
|
DebugAdapterExecutable,
|
|
108
109
|
DebugAdapterServer,
|
|
110
|
+
DebugAdapterNamedPipeServer,
|
|
111
|
+
DebugAdapterInlineImplementation,
|
|
109
112
|
Breakpoint,
|
|
110
113
|
SourceBreakpoint,
|
|
111
114
|
FunctionBreakpoint,
|
|
@@ -151,17 +154,15 @@ import { LanguagesExtImpl } from './languages';
|
|
|
151
154
|
import { fromDocumentSelector, pluginToPluginInfo, fromGlobPattern } from './type-converters';
|
|
152
155
|
import { DialogsExtImpl } from './dialogs';
|
|
153
156
|
import { NotificationExtImpl } from './notification';
|
|
154
|
-
import { CancellationToken, CancellationError } from '@theia/core/lib/common/cancellation';
|
|
155
157
|
import { score } from '@theia/callhierarchy/lib/common/language-selector';
|
|
156
158
|
import { MarkdownString } from './markdown-string';
|
|
157
159
|
import { TreeViewsExtImpl } from './tree/tree-views';
|
|
158
|
-
import {
|
|
160
|
+
import { ConnectionImpl } from '../common/connection';
|
|
159
161
|
import { TasksExtImpl } from './tasks/tasks';
|
|
160
162
|
import { DebugExtImpl } from './node/debug/debug';
|
|
161
163
|
import { FileSystemExtImpl } from './file-system-ext-impl';
|
|
162
|
-
import { QuickPick, QuickPickItem, ResourceLabelFormatter } from '@theia/plugin';
|
|
164
|
+
import { QuickPick, QuickPickItem, ResourceLabelFormatter, LineChange } from '@theia/plugin';
|
|
163
165
|
import { ScmExtImpl } from './scm';
|
|
164
|
-
import { LineChange } from '@theia/plugin';
|
|
165
166
|
import { DecorationsExtImpl } from './decorations';
|
|
166
167
|
import { TextEditorExt } from './text-editor';
|
|
167
168
|
import { ClipboardExt } from './clipboard-ext';
|
|
@@ -200,7 +201,7 @@ export function createAPIFactory(
|
|
|
200
201
|
const languagesExt = rpc.set(MAIN_RPC_CONTEXT.LANGUAGES_EXT, new LanguagesExtImpl(rpc, documents, commandRegistry));
|
|
201
202
|
const treeViewsExt = rpc.set(MAIN_RPC_CONTEXT.TREE_VIEWS_EXT, new TreeViewsExtImpl(rpc, commandRegistry));
|
|
202
203
|
const tasksExt = rpc.set(MAIN_RPC_CONTEXT.TASKS_EXT, new TasksExtImpl(rpc, terminalExt));
|
|
203
|
-
const connectionExt = rpc.set(MAIN_RPC_CONTEXT.CONNECTION_EXT, new
|
|
204
|
+
const connectionExt = rpc.set(MAIN_RPC_CONTEXT.CONNECTION_EXT, new ConnectionImpl(rpc.getProxy(PLUGIN_RPC_CONTEXT.CONNECTION_MAIN)));
|
|
204
205
|
const fileSystemExt = rpc.set(MAIN_RPC_CONTEXT.FILE_SYSTEM_EXT, new FileSystemExtImpl(rpc, languagesExt));
|
|
205
206
|
const extHostFileSystemEvent = rpc.set(MAIN_RPC_CONTEXT.ExtHostFileSystemEventService, new ExtHostFileSystemEventService(rpc, editorsAndDocumentsExt));
|
|
206
207
|
const scmExt = rpc.set(MAIN_RPC_CONTEXT.SCM_EXT, new ScmExtImpl(rpc, commandRegistry));
|
|
@@ -930,6 +931,8 @@ export function createAPIFactory(
|
|
|
930
931
|
Task2,
|
|
931
932
|
DebugAdapterExecutable,
|
|
932
933
|
DebugAdapterServer,
|
|
934
|
+
DebugAdapterNamedPipeServer,
|
|
935
|
+
DebugAdapterInlineImplementation,
|
|
933
936
|
DebugConfigurationProviderTriggerKind,
|
|
934
937
|
Breakpoint,
|
|
935
938
|
SourceBreakpoint,
|
|
@@ -16,10 +16,9 @@
|
|
|
16
16
|
|
|
17
17
|
import * as theia from '@theia/plugin';
|
|
18
18
|
import { Event, Emitter } from '@theia/core/lib/common/event';
|
|
19
|
-
import { StorageMain, StorageExt } from '../common/plugin-api-rpc';
|
|
19
|
+
import { PLUGIN_RPC_CONTEXT, StorageMain, StorageExt } from '../common/plugin-api-rpc';
|
|
20
20
|
import { KeysToAnyValues, KeysToKeysToAnyValue } from '../common/types';
|
|
21
21
|
import { RPCProtocol } from '../common/rpc-protocol';
|
|
22
|
-
import { PLUGIN_RPC_CONTEXT } from '../common/plugin-api-rpc';
|
|
23
22
|
|
|
24
23
|
export class Memento implements theia.Memento {
|
|
25
24
|
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
import { PreferenceRegistryExtImpl } from './preference-registry';
|
|
18
18
|
import * as chai from 'chai';
|
|
19
19
|
import { WorkspaceExtImpl } from '../plugin/workspace';
|
|
20
|
-
import { RPCProtocol } from '../common/rpc-protocol';
|
|
21
|
-
import { ProxyIdentifier } from '../common/rpc-protocol';
|
|
20
|
+
import { ProxyIdentifier, RPCProtocol } from '../common/rpc-protocol';
|
|
22
21
|
|
|
23
22
|
const expect = chai.expect;
|
|
24
23
|
|
package/src/plugin/quick-open.ts
CHANGED
|
@@ -30,6 +30,7 @@ import * as path from 'path';
|
|
|
30
30
|
import { convertToTransferQuickPickItems } from './type-converters';
|
|
31
31
|
import { PluginPackage } from '../common/plugin-protocol';
|
|
32
32
|
import { QuickInputButtonHandle } from '@theia/core/lib/browser';
|
|
33
|
+
import { MaybePromise } from '@theia/core/lib/common/types';
|
|
33
34
|
|
|
34
35
|
const canceledName = 'Canceled';
|
|
35
36
|
/**
|
|
@@ -64,7 +65,7 @@ export function getDarkIconUri(iconPath: URI | { light: URI; dark: URI; }): URI
|
|
|
64
65
|
export class QuickOpenExtImpl implements QuickOpenExt {
|
|
65
66
|
private proxy: QuickOpenMain;
|
|
66
67
|
private onDidSelectItem: undefined | ((handle: number) => void);
|
|
67
|
-
private validateInputHandler
|
|
68
|
+
private validateInputHandler?: (input: string) => MaybePromise<string | null | undefined>;
|
|
68
69
|
private _sessions = new Map<number, QuickInputExt>(); // Each quickinput will have a number so that we know where to fire events
|
|
69
70
|
private _instances = 0;
|
|
70
71
|
|
|
@@ -143,17 +144,13 @@ export class QuickOpenExtImpl implements QuickOpenExt {
|
|
|
143
144
|
// ---- input
|
|
144
145
|
|
|
145
146
|
showInput(options?: InputBoxOptions, token: theia.CancellationToken = CancellationToken.None): PromiseLike<string | undefined> {
|
|
146
|
-
|
|
147
|
-
this.validateInputHandler = options.validateInput;
|
|
148
|
-
}
|
|
149
|
-
|
|
147
|
+
this.validateInputHandler = options?.validateInput;
|
|
150
148
|
if (!options) { options = { placeHolder: '' }; }
|
|
151
149
|
return this.proxy.$input(options, typeof this.validateInputHandler === 'function', token);
|
|
152
150
|
}
|
|
153
151
|
|
|
154
152
|
async showInputBox(options: TransferInputBox): Promise<string | undefined> {
|
|
155
|
-
this.validateInputHandler = options
|
|
156
|
-
|
|
153
|
+
this.validateInputHandler = typeof options.validateInput === 'function' ? options.validateInput : undefined;
|
|
157
154
|
return this.proxy.$showInputBox(options, typeof this.validateInputHandler === 'function');
|
|
158
155
|
}
|
|
159
156
|
|
|
@@ -259,7 +256,7 @@ export class QuickInputExt implements QuickInput {
|
|
|
259
256
|
private onDidHideEmitter: Emitter<void>;
|
|
260
257
|
private onDidTriggerButtonEmitter: Emitter<theia.QuickInputButton>;
|
|
261
258
|
private _updateTimeout: any;
|
|
262
|
-
private _pendingUpdate: TransferQuickInput
|
|
259
|
+
private _pendingUpdate: TransferQuickInput = { id: this._id };
|
|
263
260
|
|
|
264
261
|
constructor(readonly quickOpen: QuickOpenExtImpl, readonly quickOpenMain: QuickOpenMain, readonly plugin: Plugin, private _onDidDispose: () => void) {
|
|
265
262
|
this.title = undefined;
|
|
@@ -613,9 +610,16 @@ export class QuickPickExt<T extends theia.QuickPickItem> extends QuickInputExt i
|
|
|
613
610
|
this._handlesToItems.set(i, item);
|
|
614
611
|
this._itemsToHandles.set(item, i);
|
|
615
612
|
});
|
|
616
|
-
items.forEach((item, i) => Object.assign(item, { handle: i }));
|
|
617
613
|
this.update({
|
|
618
|
-
items
|
|
614
|
+
items: items.map((item, i) => ({
|
|
615
|
+
type: item.type,
|
|
616
|
+
label: item.label,
|
|
617
|
+
description: item.description,
|
|
618
|
+
handle: i,
|
|
619
|
+
detail: item.detail,
|
|
620
|
+
picked: item.picked,
|
|
621
|
+
alwaysShow: item.alwaysShow
|
|
622
|
+
}))
|
|
619
623
|
});
|
|
620
624
|
}
|
|
621
625
|
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
import * as theia from '@theia/plugin';
|
|
25
25
|
import * as converter from '../type-converters';
|
|
26
26
|
import { CustomExecution, Disposable } from '../types-impl';
|
|
27
|
-
import { RPCProtocol
|
|
27
|
+
import { RPCProtocol } from '../../common/rpc-protocol';
|
|
28
28
|
import { TaskProviderAdapter } from './task-provider';
|
|
29
29
|
import { Emitter, Event } from '@theia/core/lib/common/event';
|
|
30
30
|
import { TerminalServiceExtImpl } from '../terminal-ext';
|
|
@@ -49,15 +49,8 @@ export class TasksExtImpl implements TasksExt {
|
|
|
49
49
|
private readonly onDidExecuteTaskProcess: Emitter<theia.TaskProcessStartEvent> = new Emitter<theia.TaskProcessStartEvent>();
|
|
50
50
|
private readonly onDidTerminateTaskProcess: Emitter<theia.TaskProcessEndEvent> = new Emitter<theia.TaskProcessEndEvent>();
|
|
51
51
|
|
|
52
|
-
private disposed = false;
|
|
53
|
-
|
|
54
52
|
constructor(rpc: RPCProtocol, readonly terminalExt: TerminalServiceExtImpl) {
|
|
55
53
|
this.proxy = rpc.getProxy(PLUGIN_RPC_CONTEXT.TASKS_MAIN);
|
|
56
|
-
this.fetchTaskExecutions();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
dispose(): void {
|
|
60
|
-
this.disposed = true;
|
|
61
54
|
}
|
|
62
55
|
|
|
63
56
|
get taskExecutions(): ReadonlyArray<theia.TaskExecution> {
|
|
@@ -216,16 +209,9 @@ export class TasksExtImpl implements TasksExt {
|
|
|
216
209
|
});
|
|
217
210
|
}
|
|
218
211
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
taskExecutions.forEach(execution => this.getTaskExecution(execution));
|
|
223
|
-
} catch (error) {
|
|
224
|
-
if (this.disposed && ConnectionClosedError.is(error)) {
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
console.error(`Can not fetch running tasks: ${error}`);
|
|
228
|
-
}
|
|
212
|
+
// Initial `this.executions` map with the running tasks from the previous session
|
|
213
|
+
async $initLoadedTasks(taskExecutions: TaskExecutionDto[]): Promise<void> {
|
|
214
|
+
taskExecutions.forEach(execution => this.getTaskExecution(execution));
|
|
229
215
|
}
|
|
230
216
|
|
|
231
217
|
private getTaskExecution(execution: TaskExecutionDto): theia.TaskExecution {
|
package/src/plugin/timeline.ts
CHANGED
|
@@ -13,10 +13,9 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { Plugin, TimelineCommandArg, TimelineExt, TimelineMain } from '../common';
|
|
16
|
+
import { Plugin, PLUGIN_RPC_CONTEXT, TimelineCommandArg, TimelineExt, TimelineMain } from '../common';
|
|
17
17
|
import { RPCProtocol } from '../common/rpc-protocol';
|
|
18
18
|
import { Disposable, URI } from './types-impl';
|
|
19
|
-
import { PLUGIN_RPC_CONTEXT } from '../common';
|
|
20
19
|
import { DisposableCollection } from '@theia/core/lib/common/disposable';
|
|
21
20
|
import { CommandRegistryImpl } from './command-registry';
|
|
22
21
|
import type {
|
|
@@ -26,7 +26,6 @@ import { LanguageFilter, LanguageSelector, RelativePattern } from '@theia/callhi
|
|
|
26
26
|
import { isMarkdownString, MarkdownString } from './markdown-string';
|
|
27
27
|
import * as types from './types-impl';
|
|
28
28
|
import { UriComponents } from '../common/uri-components';
|
|
29
|
-
import { TaskGroup } from './types-impl';
|
|
30
29
|
import { isReadonlyArray } from '../common/arrays';
|
|
31
30
|
|
|
32
31
|
const SIDE_GROUP = -2;
|
|
@@ -684,18 +683,23 @@ export function fromCallHierarchyItem(item: theia.CallHierarchyItem): model.Call
|
|
|
684
683
|
uri: item.uri,
|
|
685
684
|
range: fromRange(item.range),
|
|
686
685
|
selectionRange: fromRange(item.selectionRange),
|
|
687
|
-
tags: item.tags
|
|
686
|
+
tags: item.tags,
|
|
687
|
+
data: item.data,
|
|
688
688
|
};
|
|
689
689
|
}
|
|
690
690
|
|
|
691
691
|
export function toCallHierarchyItem(value: model.CallHierarchyItem): types.CallHierarchyItem {
|
|
692
|
-
|
|
692
|
+
const item = new types.CallHierarchyItem(
|
|
693
693
|
SymbolKind.toSymbolKind(value.kind),
|
|
694
694
|
value.name,
|
|
695
695
|
value.detail ? value.detail : '',
|
|
696
696
|
URI.revive(value.uri),
|
|
697
697
|
toRange(value.range),
|
|
698
|
-
toRange(value.selectionRange)
|
|
698
|
+
toRange(value.selectionRange),
|
|
699
|
+
);
|
|
700
|
+
item.tags = value.tags;
|
|
701
|
+
item.data = value.data;
|
|
702
|
+
return item;
|
|
699
703
|
}
|
|
700
704
|
|
|
701
705
|
export function toCallHierarchyIncomingCall(value: model.CallHierarchyIncomingCall): types.CallHierarchyIncomingCall {
|
|
@@ -744,9 +748,9 @@ export function fromTask(task: theia.Task): TaskDto | undefined {
|
|
|
744
748
|
}
|
|
745
749
|
|
|
746
750
|
const group = task.group;
|
|
747
|
-
if (group === TaskGroup.Build) {
|
|
751
|
+
if (group === types.TaskGroup.Build) {
|
|
748
752
|
taskDto.group = BUILD_GROUP;
|
|
749
|
-
} else if (group === TaskGroup.Test) {
|
|
753
|
+
} else if (group === types.TaskGroup.Test) {
|
|
750
754
|
taskDto.group = TEST_GROUP;
|
|
751
755
|
}
|
|
752
756
|
|
|
@@ -833,9 +837,9 @@ export function toTask(taskDto: TaskDto): theia.Task {
|
|
|
833
837
|
|
|
834
838
|
if (group) {
|
|
835
839
|
if (group === BUILD_GROUP) {
|
|
836
|
-
result.group = TaskGroup.Build;
|
|
840
|
+
result.group = types.TaskGroup.Build;
|
|
837
841
|
} else if (group === TEST_GROUP) {
|
|
838
|
-
result.group = TaskGroup.Test;
|
|
842
|
+
result.group = types.TaskGroup.Test;
|
|
839
843
|
}
|
|
840
844
|
}
|
|
841
845
|
|
package/src/plugin/types-impl.ts
CHANGED
|
@@ -2120,6 +2120,12 @@ export class DebugAdapterExecutable {
|
|
|
2120
2120
|
}
|
|
2121
2121
|
}
|
|
2122
2122
|
|
|
2123
|
+
export namespace DebugAdapterExecutable {
|
|
2124
|
+
export function is(adapter: theia.DebugAdapterDescriptor | undefined): adapter is theia.DebugAdapterExecutable {
|
|
2125
|
+
return !!adapter && 'command' in adapter;
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2123
2129
|
/**
|
|
2124
2130
|
* Represents a debug adapter running as a socket based server.
|
|
2125
2131
|
*/
|
|
@@ -2145,6 +2151,52 @@ export class DebugAdapterServer {
|
|
|
2145
2151
|
}
|
|
2146
2152
|
}
|
|
2147
2153
|
|
|
2154
|
+
export namespace DebugAdapterServer {
|
|
2155
|
+
export function is(adapter: theia.DebugAdapterDescriptor | undefined): adapter is DebugAdapterServer {
|
|
2156
|
+
return !!adapter && 'port' in adapter;
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
|
|
2160
|
+
/**
|
|
2161
|
+
* Represents a debug adapter running as a Named Pipe (on Windows)/UNIX Domain Socket (on non-Windows) based server.
|
|
2162
|
+
*/
|
|
2163
|
+
@es5ClassCompat
|
|
2164
|
+
export class DebugAdapterNamedPipeServer {
|
|
2165
|
+
/**
|
|
2166
|
+
* Create a description for a debug adapter running as a Named Pipe (on Windows)/UNIX Domain Socket (on non-Windows) based server.
|
|
2167
|
+
*/
|
|
2168
|
+
constructor(readonly path: string) { }
|
|
2169
|
+
}
|
|
2170
|
+
|
|
2171
|
+
export namespace DebugAdapterNamedPipeServer {
|
|
2172
|
+
export function is(adapter: theia.DebugAdapterDescriptor | undefined): adapter is DebugAdapterNamedPipeServer {
|
|
2173
|
+
return !!adapter && 'path' in adapter;
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2177
|
+
/**
|
|
2178
|
+
* A debug adapter descriptor for an inline implementation.
|
|
2179
|
+
*/
|
|
2180
|
+
@es5ClassCompat
|
|
2181
|
+
export class DebugAdapterInlineImplementation {
|
|
2182
|
+
implementation: theia.DebugAdapter;
|
|
2183
|
+
|
|
2184
|
+
/**
|
|
2185
|
+
* Create a descriptor for an inline implementation of a debug adapter.
|
|
2186
|
+
*/
|
|
2187
|
+
constructor(impl: theia.DebugAdapter) {
|
|
2188
|
+
this.implementation = impl;
|
|
2189
|
+
}
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
export namespace DebugAdapterInlineImplementation {
|
|
2193
|
+
export function is(adapter: theia.DebugAdapterDescriptor | undefined): adapter is DebugAdapterInlineImplementation {
|
|
2194
|
+
return !!adapter && 'implementation' in adapter;
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
export type DebugAdapterDescriptor = DebugAdapterExecutable | DebugAdapterServer | DebugAdapterNamedPipeServer | DebugAdapterInlineImplementation;
|
|
2199
|
+
|
|
2148
2200
|
export enum LogLevel {
|
|
2149
2201
|
Trace = 1,
|
|
2150
2202
|
Debug = 2,
|
|
@@ -2367,6 +2419,7 @@ export class CallHierarchyItem {
|
|
|
2367
2419
|
range: Range;
|
|
2368
2420
|
selectionRange: Range;
|
|
2369
2421
|
tags?: readonly SymbolTag[];
|
|
2422
|
+
data?: unknown;
|
|
2370
2423
|
|
|
2371
2424
|
constructor(kind: SymbolKind, name: string, detail: string, uri: URI, range: Range, selectionRange: Range) {
|
|
2372
2425
|
this.kind = kind;
|