@theia/plugin-ext 1.27.0-next.5 → 1.27.0-next.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/common/connection.d.ts +3 -3
- package/lib/common/connection.d.ts.map +1 -1
- package/lib/common/connection.js +0 -1
- package/lib/common/connection.js.map +1 -1
- package/lib/common/plugin-api-rpc.d.ts +21 -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-identifiers.d.ts +41 -0
- package/lib/common/plugin-identifiers.d.ts.map +1 -0
- package/lib/common/plugin-identifiers.js +81 -0
- package/lib/common/plugin-identifiers.js.map +1 -0
- package/lib/common/plugin-protocol.d.ts +41 -7
- package/lib/common/plugin-protocol.d.ts.map +1 -1
- package/lib/common/plugin-protocol.js +3 -1
- package/lib/common/plugin-protocol.js.map +1 -1
- package/lib/hosted/browser/hosted-plugin.d.ts +2 -2
- package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
- package/lib/hosted/browser/hosted-plugin.js +20 -13
- package/lib/hosted/browser/hosted-plugin.js.map +1 -1
- package/lib/hosted/browser/worker/debug-stub.d.ts +1 -1
- package/lib/hosted/browser/worker/debug-stub.d.ts.map +1 -1
- package/lib/hosted/browser/worker/debug-stub.js +2 -2
- package/lib/hosted/browser/worker/debug-stub.js.map +1 -1
- package/lib/hosted/browser/worker/plugin-manifest-loader.d.ts.map +1 -1
- package/lib/hosted/browser/worker/plugin-manifest-loader.js +4 -1
- package/lib/hosted/browser/worker/plugin-manifest-loader.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-deployer-handler.d.ts +10 -5
- package/lib/hosted/node/hosted-plugin-deployer-handler.d.ts.map +1 -1
- package/lib/hosted/node/hosted-plugin-deployer-handler.js +54 -12
- package/lib/hosted/node/hosted-plugin-deployer-handler.js.map +1 -1
- 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.map +1 -1
- package/lib/hosted/node/hosted-plugin.d.ts +2 -2
- package/lib/hosted/node/hosted-plugin.d.ts.map +1 -1
- package/lib/hosted/node/hosted-plugin.js.map +1 -1
- package/lib/hosted/node/metadata-scanner.d.ts +3 -2
- package/lib/hosted/node/metadata-scanner.d.ts.map +1 -1
- package/lib/hosted/node/metadata-scanner.js +8 -3
- package/lib/hosted/node/metadata-scanner.js.map +1 -1
- package/lib/hosted/node/plugin-host-rpc.js +2 -2
- package/lib/hosted/node/plugin-host-rpc.js.map +1 -1
- package/lib/hosted/node/plugin-manifest-loader.d.ts.map +1 -1
- package/lib/hosted/node/plugin-manifest-loader.js +3 -0
- package/lib/hosted/node/plugin-manifest-loader.js.map +1 -1
- package/lib/hosted/node/plugin-service.d.ts +18 -4
- package/lib/hosted/node/plugin-service.d.ts.map +1 -1
- package/lib/hosted/node/plugin-service.js +73 -18
- 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 +6 -3
- package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-opener.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-opener.js +2 -2
- package/lib/main/browser/custom-editors/custom-editor-opener.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-service.d.ts +6 -0
- package/lib/main/browser/debug/plugin-debug-service.d.ts.map +1 -1
- package/lib/main/browser/debug/plugin-debug-service.js +25 -3
- package/lib/main/browser/debug/plugin-debug-service.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-factory.d.ts +3 -3
- 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/documents-main.d.ts +1 -2
- package/lib/main/browser/documents-main.d.ts.map +1 -1
- package/lib/main/browser/documents-main.js +26 -6
- package/lib/main/browser/documents-main.js.map +1 -1
- package/lib/main/browser/editors-and-documents-main.d.ts +2 -0
- package/lib/main/browser/editors-and-documents-main.d.ts.map +1 -1
- package/lib/main/browser/editors-and-documents-main.js +14 -2
- package/lib/main/browser/editors-and-documents-main.js.map +1 -1
- package/lib/main/browser/languages-main.d.ts.map +1 -1
- package/lib/main/browser/languages-main.js +2 -1
- package/lib/main/browser/languages-main.js.map +1 -1
- package/lib/main/browser/main-context.d.ts.map +1 -1
- package/lib/main/browser/main-context.js +5 -4
- package/lib/main/browser/main-context.js.map +1 -1
- package/lib/main/browser/plugin-contribution-handler.d.ts +2 -0
- package/lib/main/browser/plugin-contribution-handler.d.ts.map +1 -1
- package/lib/main/browser/plugin-contribution-handler.js +36 -1
- package/lib/main/browser/plugin-contribution-handler.js.map +1 -1
- package/lib/main/browser/plugin-shared-style.d.ts +4 -2
- package/lib/main/browser/plugin-shared-style.d.ts.map +1 -1
- package/lib/main/browser/plugin-shared-style.js +15 -4
- package/lib/main/browser/plugin-shared-style.js.map +1 -1
- package/lib/main/browser/text-editors-main.d.ts +6 -3
- package/lib/main/browser/text-editors-main.d.ts.map +1 -1
- package/lib/main/browser/text-editors-main.js +8 -1
- package/lib/main/browser/text-editors-main.js.map +1 -1
- package/lib/main/browser/theming-main.d.ts +2 -1
- package/lib/main/browser/theming-main.d.ts.map +1 -1
- package/lib/main/browser/theming-main.js +3 -6
- package/lib/main/browser/theming-main.js.map +1 -1
- package/lib/main/browser/view/plugin-tree-view-node-label-provider.d.ts.map +1 -1
- package/lib/main/browser/view/plugin-tree-view-node-label-provider.js +7 -5
- package/lib/main/browser/view/plugin-tree-view-node-label-provider.js.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.d.ts +1 -1
- package/lib/main/browser/view/plugin-view-registry.d.ts.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.js +11 -6
- package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
- package/lib/main/browser/view/tree-view-widget.d.ts +10 -5
- package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
- package/lib/main/browser/view/tree-view-widget.js +39 -13
- package/lib/main/browser/view/tree-view-widget.js.map +1 -1
- package/lib/main/browser/webview/webview-theme-data-provider.d.ts +3 -1
- package/lib/main/browser/webview/webview-theme-data-provider.d.ts.map +1 -1
- package/lib/main/browser/webview/webview-theme-data-provider.js +5 -1
- package/lib/main/browser/webview/webview-theme-data-provider.js.map +1 -1
- package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts +6 -1
- package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts.map +1 -1
- package/lib/main/node/handlers/plugin-theia-directory-handler.js +61 -20
- package/lib/main/node/handlers/plugin-theia-directory-handler.js.map +1 -1
- package/lib/main/node/handlers/plugin-theia-file-handler.d.ts +4 -0
- package/lib/main/node/handlers/plugin-theia-file-handler.d.ts.map +1 -1
- package/lib/main/node/handlers/plugin-theia-file-handler.js +25 -4
- package/lib/main/node/handlers/plugin-theia-file-handler.js.map +1 -1
- package/lib/main/node/plugin-cli-contribution.d.ts +3 -0
- package/lib/main/node/plugin-cli-contribution.d.ts.map +1 -1
- package/lib/main/node/plugin-cli-contribution.js +13 -0
- package/lib/main/node/plugin-cli-contribution.js.map +1 -1
- package/lib/main/node/plugin-deployer-directory-handler-context-impl.d.ts +1 -0
- package/lib/main/node/plugin-deployer-directory-handler-context-impl.d.ts.map +1 -1
- package/lib/main/node/plugin-deployer-directory-handler-context-impl.js +17 -0
- package/lib/main/node/plugin-deployer-directory-handler-context-impl.js.map +1 -1
- package/lib/main/node/plugin-deployer-file-handler-context-impl.d.ts.map +1 -1
- package/lib/main/node/plugin-deployer-file-handler-context-impl.js +0 -1
- package/lib/main/node/plugin-deployer-file-handler-context-impl.js.map +1 -1
- package/lib/main/node/plugin-deployer-impl.d.ts +5 -2
- package/lib/main/node/plugin-deployer-impl.d.ts.map +1 -1
- package/lib/main/node/plugin-deployer-impl.js +72 -28
- package/lib/main/node/plugin-deployer-impl.js.map +1 -1
- package/lib/main/node/plugin-ext-backend-module.d.ts.map +1 -1
- package/lib/main/node/plugin-ext-backend-module.js +2 -0
- package/lib/main/node/plugin-ext-backend-module.js.map +1 -1
- package/lib/main/node/plugin-server-handler.d.ts +3 -2
- package/lib/main/node/plugin-server-handler.d.ts.map +1 -1
- package/lib/main/node/plugin-server-handler.js +3 -0
- package/lib/main/node/plugin-server-handler.js.map +1 -1
- package/lib/main/node/plugin-uninstallation-manager.d.ts +12 -0
- package/lib/main/node/plugin-uninstallation-manager.d.ts.map +1 -0
- package/lib/main/node/plugin-uninstallation-manager.js +66 -0
- package/lib/main/node/plugin-uninstallation-manager.js.map +1 -0
- 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.map +1 -1
- package/lib/plugin/{node/debug/debug.d.ts → debug/debug-ext.d.ts} +15 -13
- package/lib/plugin/debug/debug-ext.d.ts.map +1 -0
- package/lib/plugin/{node/debug/debug.js → debug/debug-ext.js} +17 -51
- package/lib/plugin/debug/debug-ext.js.map +1 -0
- package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts +11 -0
- package/lib/plugin/debug/plugin-debug-adapter-creator.d.ts.map +1 -0
- package/lib/plugin/debug/plugin-debug-adapter-creator.js +42 -0
- package/lib/plugin/debug/plugin-debug-adapter-creator.js.map +1 -0
- package/lib/plugin/{node/debug → debug}/plugin-debug-adapter-session.d.ts +4 -4
- package/lib/plugin/debug/plugin-debug-adapter-session.d.ts.map +1 -0
- package/lib/plugin/{node/debug → debug}/plugin-debug-adapter-session.js +1 -1
- package/lib/plugin/debug/plugin-debug-adapter-session.js.map +1 -0
- package/lib/plugin/{node/debug → debug}/plugin-debug-adapter-tracker.d.ts +0 -0
- package/lib/plugin/debug/plugin-debug-adapter-tracker.d.ts.map +1 -0
- package/lib/plugin/{node/debug → debug}/plugin-debug-adapter-tracker.js +0 -0
- package/lib/plugin/debug/plugin-debug-adapter-tracker.js.map +1 -0
- package/lib/plugin/languages-utils.d.ts.map +1 -1
- package/lib/plugin/languages-utils.js +3 -2
- package/lib/plugin/languages-utils.js.map +1 -1
- package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts +18 -0
- package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.d.ts.map +1 -0
- package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.js +155 -0
- package/lib/plugin/node/debug/plugin-node-debug-adapter-creator.js.map +1 -0
- package/lib/plugin/plugin-context.d.ts +1 -1
- package/lib/plugin/plugin-context.d.ts.map +1 -1
- package/lib/plugin/plugin-context.js +1 -2
- package/lib/plugin/plugin-context.js.map +1 -1
- package/lib/plugin/text-editor.d.ts +2 -0
- package/lib/plugin/text-editor.d.ts.map +1 -1
- package/lib/plugin/text-editor.js +9 -0
- package/lib/plugin/text-editor.js.map +1 -1
- package/lib/plugin/theming.d.ts +1 -1
- package/lib/plugin/theming.d.ts.map +1 -1
- package/lib/plugin/tree/tree-views.d.ts +1 -0
- package/lib/plugin/tree/tree-views.d.ts.map +1 -1
- package/lib/plugin/tree/tree-views.js +10 -9
- package/lib/plugin/tree/tree-views.js.map +1 -1
- package/lib/plugin/types-impl.d.ts +1 -0
- package/lib/plugin/types-impl.d.ts.map +1 -1
- package/lib/plugin/types-impl.js +3 -2
- package/lib/plugin/types-impl.js.map +1 -1
- package/package.json +25 -24
- package/src/common/connection.ts +3 -4
- package/src/common/plugin-api-rpc.ts +24 -17
- package/src/common/plugin-identifiers.ts +84 -0
- package/src/common/plugin-protocol.ts +47 -8
- package/src/hosted/browser/hosted-plugin.ts +22 -16
- package/src/hosted/browser/worker/debug-stub.ts +1 -1
- package/src/hosted/browser/worker/plugin-manifest-loader.ts +4 -2
- package/src/hosted/node/hosted-plugin-deployer-handler.ts +64 -20
- package/src/hosted/node/hosted-plugin-process.ts +4 -4
- package/src/hosted/node/hosted-plugin.ts +2 -2
- package/src/hosted/node/metadata-scanner.ts +8 -6
- package/src/hosted/node/plugin-host-rpc.ts +2 -2
- package/src/hosted/node/plugin-manifest-loader.ts +2 -0
- package/src/hosted/node/plugin-service.ts +79 -23
- package/src/hosted/node/scanners/scanner-theia.ts +7 -4
- package/src/main/browser/custom-editors/custom-editor-opener.tsx +2 -2
- package/src/main/browser/debug/plugin-debug-service.ts +32 -3
- package/src/main/browser/debug/plugin-debug-session-factory.ts +2 -2
- package/src/main/browser/documents-main.ts +26 -8
- package/src/main/browser/editors-and-documents-main.ts +16 -2
- package/src/main/browser/languages-main.ts +2 -1
- package/src/main/browser/main-context.ts +4 -3
- package/src/main/browser/plugin-contribution-handler.ts +41 -3
- package/src/main/browser/plugin-icon-theme-service.ts +1 -1
- package/src/main/browser/plugin-shared-style.ts +9 -5
- package/src/main/browser/text-editors-main.ts +12 -2
- package/src/main/browser/theming-main.ts +3 -7
- package/src/main/browser/view/plugin-tree-view-node-label-provider.ts +7 -5
- package/src/main/browser/view/plugin-view-registry.ts +12 -7
- package/src/main/browser/view/tree-view-widget.tsx +44 -16
- package/src/main/browser/webview/webview-theme-data-provider.ts +7 -10
- package/src/main/node/handlers/plugin-theia-directory-handler.ts +56 -28
- package/src/main/node/handlers/plugin-theia-file-handler.ts +25 -4
- package/src/main/node/plugin-cli-contribution.ts +12 -0
- package/src/main/node/plugin-deployer-directory-handler-context-impl.ts +17 -1
- package/src/main/node/plugin-deployer-file-handler-context-impl.ts +0 -1
- package/src/main/node/plugin-deployer-impl.ts +75 -30
- package/src/main/node/plugin-ext-backend-module.ts +3 -0
- package/src/main/node/plugin-server-handler.ts +6 -2
- package/src/main/node/plugin-uninstallation-manager.ts +60 -0
- package/src/plugin/custom-editors.ts +2 -3
- package/src/plugin/{node/debug/debug.ts → debug/debug-ext.ts} +25 -56
- package/src/plugin/debug/plugin-debug-adapter-creator.ts +50 -0
- package/src/plugin/{node/debug → debug}/plugin-debug-adapter-session.ts +4 -4
- package/src/plugin/{node/debug → debug}/plugin-debug-adapter-tracker.ts +0 -0
- package/src/plugin/languages-utils.ts +3 -2
- package/src/plugin/node/debug/plugin-node-debug-adapter-creator.ts +167 -0
- package/src/plugin/plugin-context.ts +2 -3
- package/src/plugin/text-editor.ts +16 -5
- package/src/plugin/theming.ts +1 -1
- package/src/plugin/tree/tree-views.ts +15 -12
- package/src/plugin/types-impl.ts +1 -1
- package/lib/main/browser/custom-editors/glob.d.ts +0 -51
- package/lib/main/browser/custom-editors/glob.d.ts.map +0 -1
- package/lib/main/browser/custom-editors/glob.js +0 -593
- package/lib/main/browser/custom-editors/glob.js.map +0 -1
- package/lib/main/browser/custom-editors/paths.d.ts +0 -25
- package/lib/main/browser/custom-editors/paths.d.ts.map +0 -1
- package/lib/main/browser/custom-editors/paths.js +0 -227
- package/lib/main/browser/custom-editors/paths.js.map +0 -1
- package/lib/main/browser/editor/untitled-resource.d.ts +0 -3
- package/lib/main/browser/editor/untitled-resource.d.ts.map +0 -1
- package/lib/main/browser/editor/untitled-resource.js +0 -24
- package/lib/main/browser/editor/untitled-resource.js.map +0 -1
- package/lib/plugin/node/debug/debug.d.ts.map +0 -1
- package/lib/plugin/node/debug/debug.js.map +0 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-executable-resolver.d.ts +0 -7
- package/lib/plugin/node/debug/plugin-debug-adapter-executable-resolver.d.ts.map +0 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-executable-resolver.js +0 -57
- package/lib/plugin/node/debug/plugin-debug-adapter-executable-resolver.js.map +0 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-session.d.ts.map +0 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-session.js.map +0 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-starter.d.ts +0 -15
- package/lib/plugin/node/debug/plugin-debug-adapter-starter.d.ts.map +0 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-starter.js +0 -85
- package/lib/plugin/node/debug/plugin-debug-adapter-starter.js.map +0 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-tracker.d.ts.map +0 -1
- package/lib/plugin/node/debug/plugin-debug-adapter-tracker.js.map +0 -1
- package/lib/plugin/node/debug/plugin-inline-debug-adapter.d.ts +0 -19
- package/lib/plugin/node/debug/plugin-inline-debug-adapter.d.ts.map +0 -1
- package/lib/plugin/node/debug/plugin-inline-debug-adapter.js +0 -45
- package/lib/plugin/node/debug/plugin-inline-debug-adapter.js.map +0 -1
- package/src/main/browser/custom-editors/glob.ts +0 -743
- package/src/main/browser/custom-editors/paths.ts +0 -250
- package/src/main/browser/editor/untitled-resource.ts +0 -18
- package/src/plugin/node/debug/plugin-debug-adapter-executable-resolver.ts +0 -58
- package/src/plugin/node/debug/plugin-debug-adapter-starter.ts +0 -86
- package/src/plugin/node/debug/plugin-inline-debug-adapter.ts +0 -47
|
@@ -17,11 +17,12 @@
|
|
|
17
17
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
18
18
|
|
|
19
19
|
import { injectable, optional, multiInject, inject, named } from '@theia/core/shared/inversify';
|
|
20
|
+
import * as semver from 'semver';
|
|
20
21
|
import {
|
|
21
22
|
PluginDeployerResolver, PluginDeployerFileHandler, PluginDeployerDirectoryHandler,
|
|
22
23
|
PluginDeployerEntry, PluginDeployer, PluginDeployerParticipant, PluginDeployerStartContext,
|
|
23
24
|
PluginDeployerResolverInit, PluginDeployerFileHandlerContext,
|
|
24
|
-
PluginDeployerDirectoryHandlerContext, PluginDeployerEntryType, PluginDeployerHandler, PluginType, UnresolvedPluginEntry
|
|
25
|
+
PluginDeployerDirectoryHandlerContext, PluginDeployerEntryType, PluginDeployerHandler, PluginType, UnresolvedPluginEntry, PluginIdentifiers
|
|
25
26
|
} from '../../common/plugin-protocol';
|
|
26
27
|
import { PluginDeployerEntryImpl } from './plugin-deployer-entry-impl';
|
|
27
28
|
import {
|
|
@@ -135,7 +136,11 @@ export class PluginDeployerImpl implements PluginDeployer {
|
|
|
135
136
|
deployPlugins.log('Deploy plugins list');
|
|
136
137
|
}
|
|
137
138
|
|
|
138
|
-
async
|
|
139
|
+
async uninstall(pluginId: PluginIdentifiers.VersionedId): Promise<void> {
|
|
140
|
+
await this.pluginDeployerHandler.uninstallPlugin(pluginId);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async undeploy(pluginId: PluginIdentifiers.VersionedId): Promise<void> {
|
|
139
144
|
if (await this.pluginDeployerHandler.undeployPlugin(pluginId)) {
|
|
140
145
|
this.onDidDeployEmitter.fire();
|
|
141
146
|
}
|
|
@@ -163,49 +168,49 @@ export class PluginDeployerImpl implements PluginDeployer {
|
|
|
163
168
|
*/
|
|
164
169
|
async resolvePlugins(plugins: UnresolvedPluginEntry[]): Promise<PluginDeployerEntry[]> {
|
|
165
170
|
const visited = new Set<string>();
|
|
166
|
-
const
|
|
171
|
+
const hasBeenVisited = (id: string) => visited.has(id) || (visited.add(id), false);
|
|
172
|
+
const pluginsToDeploy = new Map<PluginIdentifiers.VersionedId, PluginDeployerEntry>();
|
|
173
|
+
const unversionedIdsHandled = new Map<PluginIdentifiers.UnversionedId, string[]>();
|
|
167
174
|
|
|
168
|
-
|
|
175
|
+
const queue: UnresolvedPluginEntry[] = [...plugins];
|
|
169
176
|
while (queue.length) {
|
|
170
|
-
const
|
|
177
|
+
const pendingDependencies: Array<{
|
|
171
178
|
dependencies: Map<string, string>
|
|
172
179
|
type: PluginType
|
|
173
180
|
}> = [];
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if (visited.has(current.id)) {
|
|
178
|
-
continue;
|
|
179
|
-
} else {
|
|
180
|
-
workload.push(current);
|
|
181
|
-
}
|
|
182
|
-
visited.add(current.id);
|
|
183
|
-
}
|
|
184
|
-
queue = [];
|
|
185
|
-
await Promise.all(workload.map(async ({ id, type }) => {
|
|
186
|
-
if (type === undefined) {
|
|
187
|
-
type = PluginType.System;
|
|
181
|
+
await Promise.all(queue.map(async entry => {
|
|
182
|
+
if (hasBeenVisited(entry.id)) {
|
|
183
|
+
return;
|
|
188
184
|
}
|
|
185
|
+
const type = entry.type ?? PluginType.System;
|
|
189
186
|
try {
|
|
190
|
-
const pluginDeployerEntries = await this.
|
|
191
|
-
await this.applyFileHandlers(pluginDeployerEntries);
|
|
192
|
-
await this.applyDirectoryFileHandlers(pluginDeployerEntries);
|
|
187
|
+
const pluginDeployerEntries = await this.resolveAndHandle(entry.id, type);
|
|
193
188
|
for (const deployerEntry of pluginDeployerEntries) {
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
189
|
+
const pluginData = await this.pluginDeployerHandler.getPluginDependencies(deployerEntry);
|
|
190
|
+
const versionedId = pluginData && PluginIdentifiers.componentsToVersionedId(pluginData.metadata.model);
|
|
191
|
+
const unversionedId = versionedId && PluginIdentifiers.componentsToUnversionedId(pluginData.metadata.model);
|
|
192
|
+
if (unversionedId && !pluginsToDeploy.has(versionedId)) {
|
|
193
|
+
pluginsToDeploy.set(versionedId, deployerEntry);
|
|
194
|
+
if (pluginData.mapping) {
|
|
195
|
+
pendingDependencies.push({ dependencies: pluginData.mapping, type });
|
|
196
|
+
}
|
|
197
|
+
const otherVersions = unversionedIdsHandled.get(unversionedId) ?? [];
|
|
198
|
+
otherVersions.push(pluginData.metadata.model.version);
|
|
199
|
+
if (otherVersions.length === 1) {
|
|
200
|
+
unversionedIdsHandled.set(unversionedId, otherVersions);
|
|
201
|
+
} else {
|
|
202
|
+
this.findBestVersion(unversionedId, otherVersions, pluginsToDeploy);
|
|
199
203
|
}
|
|
200
204
|
}
|
|
201
205
|
}
|
|
202
206
|
} catch (e) {
|
|
203
|
-
console.error(`Failed to resolve plugins from '${id}'`, e);
|
|
207
|
+
console.error(`Failed to resolve plugins from '${entry.id}'`, e);
|
|
204
208
|
}
|
|
205
209
|
}));
|
|
206
|
-
|
|
210
|
+
queue.length = 0;
|
|
211
|
+
for (const { dependencies, type } of pendingDependencies) {
|
|
207
212
|
for (const [dependency, deployableDependency] of dependencies) {
|
|
208
|
-
if (!
|
|
213
|
+
if (!unversionedIdsHandled.has(dependency as PluginIdentifiers.UnversionedId)) {
|
|
209
214
|
queue.push({
|
|
210
215
|
id: deployableDependency,
|
|
211
216
|
type
|
|
@@ -217,6 +222,46 @@ export class PluginDeployerImpl implements PluginDeployer {
|
|
|
217
222
|
return [...pluginsToDeploy.values()];
|
|
218
223
|
}
|
|
219
224
|
|
|
225
|
+
protected async resolveAndHandle(id: string, type: PluginType): Promise<PluginDeployerEntry[]> {
|
|
226
|
+
const entries = await this.resolvePlugin(id, type);
|
|
227
|
+
await this.applyFileHandlers(entries);
|
|
228
|
+
await this.applyDirectoryFileHandlers(entries);
|
|
229
|
+
return entries;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
protected findBestVersion(unversionedId: PluginIdentifiers.UnversionedId, versions: string[], knownPlugins: Map<PluginIdentifiers.VersionedId, PluginDeployerEntry>): void {
|
|
233
|
+
// If left better, return negative. Then best is index 0.
|
|
234
|
+
versions.map(version => ({ version, plugin: knownPlugins.get(PluginIdentifiers.idAndVersionToVersionedId({ version, id: unversionedId })) }))
|
|
235
|
+
.sort((left, right) => {
|
|
236
|
+
const leftPlugin = left.plugin;
|
|
237
|
+
const rightPlugin = right.plugin;
|
|
238
|
+
if (!leftPlugin && !rightPlugin) {
|
|
239
|
+
return 0;
|
|
240
|
+
}
|
|
241
|
+
if (!rightPlugin) {
|
|
242
|
+
return -1;
|
|
243
|
+
}
|
|
244
|
+
if (!leftPlugin) {
|
|
245
|
+
return 1;
|
|
246
|
+
}
|
|
247
|
+
if (leftPlugin.type === PluginType.System && rightPlugin.type === PluginType.User) {
|
|
248
|
+
return -1;
|
|
249
|
+
}
|
|
250
|
+
if (leftPlugin.type === PluginType.User && rightPlugin.type === PluginType.System) {
|
|
251
|
+
return 1;
|
|
252
|
+
}
|
|
253
|
+
if (semver.gtr(left.version, right.version)) {
|
|
254
|
+
return -1;
|
|
255
|
+
}
|
|
256
|
+
return 1;
|
|
257
|
+
}).forEach((versionedEntry, index) => {
|
|
258
|
+
if (index !== 0) {
|
|
259
|
+
// Mark as not accepted to prevent deployment of all but the winner.
|
|
260
|
+
versionedEntry.plugin?.accept();
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
|
|
220
265
|
/**
|
|
221
266
|
* deploy all plugins that have been accepted
|
|
222
267
|
*/
|
|
@@ -39,6 +39,7 @@ import { PluginCliContribution } from './plugin-cli-contribution';
|
|
|
39
39
|
import { PluginTheiaEnvironment } from '../common/plugin-theia-environment';
|
|
40
40
|
import { PluginTheiaDeployerParticipant } from './plugin-theia-deployer-participant';
|
|
41
41
|
import { WebviewBackendSecurityWarnings } from './webview-backend-security-warnings';
|
|
42
|
+
import { PluginUninstallationManager } from './plugin-uninstallation-manager';
|
|
42
43
|
|
|
43
44
|
export function bindMainBackend(bind: interfaces.Bind): void {
|
|
44
45
|
bind(PluginApiContribution).toSelf().inSingletonScope();
|
|
@@ -50,6 +51,8 @@ export function bindMainBackend(bind: interfaces.Bind): void {
|
|
|
50
51
|
bind(PluginDeployerContribution).toSelf().inSingletonScope();
|
|
51
52
|
bind(BackendApplicationContribution).toService(PluginDeployerContribution);
|
|
52
53
|
|
|
54
|
+
bind(PluginUninstallationManager).toSelf().inSingletonScope();
|
|
55
|
+
|
|
53
56
|
bind(PluginDeployerResolver).to(LocalDirectoryPluginDeployerResolver).inSingletonScope();
|
|
54
57
|
bind(PluginDeployerResolver).to(LocalFilePluginDeployerResolver).inSingletonScope();
|
|
55
58
|
bind(PluginDeployerResolver).to(GithubPluginDeployerResolver).inSingletonScope();
|
|
@@ -18,7 +18,7 @@ import { injectable, inject } from '@theia/core/shared/inversify';
|
|
|
18
18
|
import { CancellationToken } from '@theia/core/lib/common/cancellation';
|
|
19
19
|
import { PluginDeployerImpl } from './plugin-deployer-impl';
|
|
20
20
|
import { PluginsKeyValueStorage } from './plugins-key-value-storage';
|
|
21
|
-
import { PluginServer, PluginDeployer, PluginStorageKind, PluginType, UnresolvedPluginEntry } from '../../common/plugin-protocol';
|
|
21
|
+
import { PluginServer, PluginDeployer, PluginStorageKind, PluginType, UnresolvedPluginEntry, PluginIdentifiers } from '../../common/plugin-protocol';
|
|
22
22
|
import { KeysToAnyValues, KeysToKeysToAnyValue } from '../../common/types';
|
|
23
23
|
|
|
24
24
|
@injectable()
|
|
@@ -42,7 +42,11 @@ export class PluginServerHandler implements PluginServer {
|
|
|
42
42
|
return this.pluginDeployer.deploy(pluginEntry);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
uninstall(pluginId: PluginIdentifiers.VersionedId): Promise<void> {
|
|
46
|
+
return this.pluginDeployer.uninstall(pluginId);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
undeploy(pluginId: PluginIdentifiers.VersionedId): Promise<void> {
|
|
46
50
|
return this.pluginDeployer.undeploy(pluginId);
|
|
47
51
|
}
|
|
48
52
|
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2022 Ericsson and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { Emitter, Event } from '@theia/core';
|
|
18
|
+
import { injectable } from '@theia/core/shared/inversify';
|
|
19
|
+
import { PluginIdentifiers } from '../../common';
|
|
20
|
+
|
|
21
|
+
@injectable()
|
|
22
|
+
export class PluginUninstallationManager {
|
|
23
|
+
protected readonly onDidChangeUninstalledPluginsEmitter = new Emitter<readonly PluginIdentifiers.VersionedId[]>();
|
|
24
|
+
|
|
25
|
+
get onDidChangeUninstalledPlugins(): Event<readonly PluginIdentifiers.VersionedId[]> {
|
|
26
|
+
return this.onDidChangeUninstalledPluginsEmitter.event;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
protected uninstalledPlugins: PluginIdentifiers.VersionedId[] = [];
|
|
30
|
+
|
|
31
|
+
markAsUninstalled(pluginId: PluginIdentifiers.VersionedId): boolean {
|
|
32
|
+
if (!this.uninstalledPlugins.includes(pluginId)) {
|
|
33
|
+
this.uninstalledPlugins.push(pluginId);
|
|
34
|
+
this.onDidChangeUninstalledPluginsEmitter.fire(Object.freeze(this.uninstalledPlugins.slice()));
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
markAsInstalled(pluginId: PluginIdentifiers.VersionedId): boolean {
|
|
41
|
+
let index: number;
|
|
42
|
+
let didChange = false;
|
|
43
|
+
while ((index = this.uninstalledPlugins.indexOf(pluginId)) !== -1) {
|
|
44
|
+
this.uninstalledPlugins.splice(index, 1);
|
|
45
|
+
didChange = true;
|
|
46
|
+
}
|
|
47
|
+
if (didChange) {
|
|
48
|
+
this.onDidChangeUninstalledPluginsEmitter.fire(Object.freeze(this.uninstalledPlugins.slice()));
|
|
49
|
+
}
|
|
50
|
+
return didChange;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
isUninstalled(pluginId: PluginIdentifiers.VersionedId): boolean {
|
|
54
|
+
return this.uninstalledPlugins.includes(pluginId);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
getUninstalledPluginIds(): readonly PluginIdentifiers.VersionedId[] {
|
|
58
|
+
return Object.freeze(this.uninstalledPlugins.slice());
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -29,7 +29,6 @@ import { WebviewImpl, WebviewsExtImpl } from './webviews';
|
|
|
29
29
|
import { CancellationToken, CancellationTokenSource } from '@theia/core/lib/common/cancellation';
|
|
30
30
|
import { DisposableCollection } from '@theia/core/lib/common/disposable';
|
|
31
31
|
import { WorkspaceExtImpl } from './workspace';
|
|
32
|
-
import { WidgetOpenerOptions } from '@theia/core/lib/browser';
|
|
33
32
|
|
|
34
33
|
export class CustomEditorsExtImpl implements CustomEditorsExt {
|
|
35
34
|
private readonly proxy: CustomEditorsMain;
|
|
@@ -116,12 +115,12 @@ export class CustomEditorsExtImpl implements CustomEditorsExt {
|
|
|
116
115
|
document.dispose();
|
|
117
116
|
}
|
|
118
117
|
|
|
119
|
-
async $resolveWebviewEditor(
|
|
118
|
+
async $resolveWebviewEditor<T>(
|
|
120
119
|
resource: UriComponents,
|
|
121
120
|
handler: string,
|
|
122
121
|
viewType: string,
|
|
123
122
|
title: string,
|
|
124
|
-
widgetOpenerOptions:
|
|
123
|
+
widgetOpenerOptions: T | undefined,
|
|
125
124
|
options: theia.WebviewPanelOptions & theia.WebviewOptions,
|
|
126
125
|
cancellation: CancellationToken
|
|
127
126
|
): Promise<void> {
|
|
@@ -17,22 +17,19 @@ import { Emitter } from '@theia/core/lib/common/event';
|
|
|
17
17
|
import { Path } from '@theia/core/lib/common/path';
|
|
18
18
|
import * as theia from '@theia/plugin';
|
|
19
19
|
import { URI } from '@theia/core/shared/vscode-uri';
|
|
20
|
-
import { Breakpoint } from '
|
|
21
|
-
import { DebugConfigurationProviderTriggerKind, DebugExt, DebugMain, PLUGIN_RPC_CONTEXT as Ext, TerminalOptionsExt } from '
|
|
22
|
-
import { PluginPackageDebuggersContribution } from '
|
|
23
|
-
import { RPCProtocol } from '
|
|
24
|
-
import { CommandRegistryImpl } from '
|
|
25
|
-
import { ConnectionImpl } from '
|
|
26
|
-
import {
|
|
27
|
-
Disposable, Breakpoint as BreakpointExt, SourceBreakpoint, FunctionBreakpoint, Location, Range,
|
|
28
|
-
DebugAdapterServer, DebugAdapterExecutable, DebugAdapterNamedPipeServer, DebugAdapterInlineImplementation
|
|
29
|
-
} from '../../types-impl';
|
|
30
|
-
import { resolveDebugAdapterExecutable } from './plugin-debug-adapter-executable-resolver';
|
|
20
|
+
import { Breakpoint } from '../../common/plugin-api-rpc-model';
|
|
21
|
+
import { DebugConfigurationProviderTriggerKind, DebugExt, DebugMain, PLUGIN_RPC_CONTEXT as Ext, TerminalOptionsExt } from '../../common/plugin-api-rpc';
|
|
22
|
+
import { PluginPackageDebuggersContribution } from '../../common/plugin-protocol';
|
|
23
|
+
import { RPCProtocol } from '../../common/rpc-protocol';
|
|
24
|
+
import { CommandRegistryImpl } from '../command-registry';
|
|
25
|
+
import { ConnectionImpl } from '../../common/connection';
|
|
26
|
+
import { Disposable, Breakpoint as BreakpointExt, SourceBreakpoint, FunctionBreakpoint, Location, Range } from '../types-impl';
|
|
31
27
|
import { PluginDebugAdapterSession } from './plugin-debug-adapter-session';
|
|
32
|
-
import { connectInlineDebugAdapter, connectPipeDebugAdapter, connectSocketDebugAdapter, startDebugAdapter } from './plugin-debug-adapter-starter';
|
|
33
28
|
import { PluginDebugAdapterTracker } from './plugin-debug-adapter-tracker';
|
|
34
29
|
import uuid = require('uuid');
|
|
35
|
-
import { DebugAdapter } from '@theia/debug/lib/
|
|
30
|
+
import { DebugAdapter } from '@theia/debug/lib/common/debug-model';
|
|
31
|
+
import { PluginDebugAdapterCreator } from './plugin-debug-adapter-creator';
|
|
32
|
+
import { NodeDebugAdapterCreator } from '../node/debug/plugin-node-debug-adapter-creator';
|
|
36
33
|
|
|
37
34
|
interface ConfigurationProviderRecord {
|
|
38
35
|
handle: number;
|
|
@@ -42,10 +39,7 @@ interface ConfigurationProviderRecord {
|
|
|
42
39
|
}
|
|
43
40
|
|
|
44
41
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* It is supposed to work at node only.
|
|
48
|
-
*/
|
|
42
|
+
|
|
49
43
|
export class DebugExtImpl implements DebugExt {
|
|
50
44
|
// debug sessions by sessionId
|
|
51
45
|
private sessions = new Map<string, PluginDebugAdapterSession>();
|
|
@@ -60,6 +54,7 @@ export class DebugExtImpl implements DebugExt {
|
|
|
60
54
|
private descriptorFactories = new Map<string, theia.DebugAdapterDescriptorFactory>();
|
|
61
55
|
private trackerFactories: [string, theia.DebugAdapterTrackerFactory][] = [];
|
|
62
56
|
private contributionPaths = new Map<string, string>();
|
|
57
|
+
private contributionTypes = new Map<string, theia.PluginType>();
|
|
63
58
|
|
|
64
59
|
private connectionExt: ConnectionImpl;
|
|
65
60
|
private commandRegistryExt: CommandRegistryImpl;
|
|
@@ -77,6 +72,9 @@ export class DebugExtImpl implements DebugExt {
|
|
|
77
72
|
|
|
78
73
|
private readonly _breakpoints = new Map<string, theia.Breakpoint>();
|
|
79
74
|
|
|
75
|
+
private frontendAdapterCreator = new PluginDebugAdapterCreator();
|
|
76
|
+
private backendAdapterCreator = new NodeDebugAdapterCreator();
|
|
77
|
+
|
|
80
78
|
get breakpoints(): theia.Breakpoint[] {
|
|
81
79
|
return [...this._breakpoints.values()];
|
|
82
80
|
}
|
|
@@ -102,11 +100,13 @@ export class DebugExtImpl implements DebugExt {
|
|
|
102
100
|
/**
|
|
103
101
|
* Registers contributions.
|
|
104
102
|
* @param pluginFolder plugin folder path
|
|
103
|
+
* @param pluginType plugin type
|
|
105
104
|
* @param contributions available debuggers contributions
|
|
106
105
|
*/
|
|
107
|
-
registerDebuggersContributions(pluginFolder: string, contributions: PluginPackageDebuggersContribution[]): void {
|
|
106
|
+
registerDebuggersContributions(pluginFolder: string, pluginType: theia.PluginType, contributions: PluginPackageDebuggersContribution[]): void {
|
|
108
107
|
contributions.forEach(contribution => {
|
|
109
108
|
this.contributionPaths.set(contribution.type, pluginFolder);
|
|
109
|
+
this.contributionTypes.set(contribution.type, pluginType);
|
|
110
110
|
this.debuggersContributions.set(contribution.type, contribution);
|
|
111
111
|
this.proxy.$registerDebuggerContribution({
|
|
112
112
|
type: contribution.type,
|
|
@@ -397,43 +397,7 @@ export class DebugExtImpl implements DebugExt {
|
|
|
397
397
|
protected async createDebugAdapter(session: theia.DebugSession, debugConfiguration: theia.DebugConfiguration): Promise<DebugAdapter> {
|
|
398
398
|
const executable = await this.resolveDebugAdapterExecutable(debugConfiguration);
|
|
399
399
|
const descriptorFactory = this.descriptorFactories.get(session.type);
|
|
400
|
-
|
|
401
|
-
// 'createDebugAdapterDescriptor' is called at the start of a debug session to provide details about the debug adapter to use.
|
|
402
|
-
// These details must be returned as objects of type [DebugAdapterDescriptor](#DebugAdapterDescriptor).
|
|
403
|
-
// Currently two types of debug adapters are supported:
|
|
404
|
-
// - a debug adapter executable is specified as a command path and arguments (see [DebugAdapterExecutable](#DebugAdapterExecutable)),
|
|
405
|
-
// - a debug adapter server reachable via a communication port (see [DebugAdapterServer](#DebugAdapterServer)).
|
|
406
|
-
// If the method is not implemented the default behavior is this:
|
|
407
|
-
// createDebugAdapter(session: DebugSession, executable: DebugAdapterExecutable) {
|
|
408
|
-
// if (typeof session.configuration.debugServer === 'number') {
|
|
409
|
-
// return new DebugAdapterServer(session.configuration.debugServer);
|
|
410
|
-
// }
|
|
411
|
-
// return executable;
|
|
412
|
-
// }
|
|
413
|
-
// @param session The [debug session](#DebugSession) for which the debug adapter will be used.
|
|
414
|
-
// @param executable The debug adapter's executable information as specified in the package.json (or undefined if no such information exists).
|
|
415
|
-
const descriptor = await descriptorFactory.createDebugAdapterDescriptor(session, executable);
|
|
416
|
-
if (descriptor) {
|
|
417
|
-
if (DebugAdapterServer.is(descriptor)) {
|
|
418
|
-
return connectSocketDebugAdapter(descriptor);
|
|
419
|
-
} else if (DebugAdapterExecutable.is(descriptor)) {
|
|
420
|
-
return startDebugAdapter(descriptor);
|
|
421
|
-
} else if (DebugAdapterNamedPipeServer.is(descriptor)) {
|
|
422
|
-
return connectPipeDebugAdapter(descriptor);
|
|
423
|
-
} else if (DebugAdapterInlineImplementation.is(descriptor)) {
|
|
424
|
-
return connectInlineDebugAdapter(descriptor);
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
if ('debugServer' in debugConfiguration) {
|
|
430
|
-
return connectSocketDebugAdapter({ port: debugConfiguration.debugServer });
|
|
431
|
-
} else {
|
|
432
|
-
if (!executable) {
|
|
433
|
-
throw new Error('It is not possible to provide debug adapter executable.');
|
|
434
|
-
}
|
|
435
|
-
return startDebugAdapter(executable);
|
|
436
|
-
}
|
|
400
|
+
return this.getAdapterCreator(debugConfiguration).createDebugAdapter(session, debugConfiguration, executable, descriptorFactory);
|
|
437
401
|
}
|
|
438
402
|
|
|
439
403
|
protected async resolveDebugAdapterExecutable(debugConfiguration: theia.DebugConfiguration): Promise<theia.DebugAdapterExecutable | undefined> {
|
|
@@ -448,7 +412,7 @@ export class DebugExtImpl implements DebugExt {
|
|
|
448
412
|
} else {
|
|
449
413
|
const contributionPath = this.contributionPaths.get(type);
|
|
450
414
|
if (contributionPath) {
|
|
451
|
-
return resolveDebugAdapterExecutable(contributionPath, contribution);
|
|
415
|
+
return this.getAdapterCreator(debugConfiguration).resolveDebugAdapterExecutable(contributionPath, contribution);
|
|
452
416
|
}
|
|
453
417
|
}
|
|
454
418
|
}
|
|
@@ -469,4 +433,9 @@ export class DebugExtImpl implements DebugExt {
|
|
|
469
433
|
index: 0
|
|
470
434
|
};
|
|
471
435
|
}
|
|
436
|
+
|
|
437
|
+
private getAdapterCreator(debugConfiguration: theia.DebugConfiguration): PluginDebugAdapterCreator {
|
|
438
|
+
const pluginType = this.contributionTypes.get(debugConfiguration.type);
|
|
439
|
+
return pluginType === 'frontend' ? this.frontendAdapterCreator : this.backendAdapterCreator;
|
|
440
|
+
}
|
|
472
441
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2022 Arm and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import * as theia from '@theia/plugin';
|
|
18
|
+
import { DebugAdapter } from '@theia/debug/lib/common/debug-model';
|
|
19
|
+
import { PluginPackageDebuggersContribution } from '../../common';
|
|
20
|
+
import { DebugAdapterInlineImplementation } from '../types-impl';
|
|
21
|
+
import { InlineDebugAdapter } from '@theia/debug/lib/common/inline-debug-adapter';
|
|
22
|
+
|
|
23
|
+
export class PluginDebugAdapterCreator {
|
|
24
|
+
public async resolveDebugAdapterExecutable(_pluginPath: string, _debuggerContribution: PluginPackageDebuggersContribution): Promise<theia.DebugAdapterExecutable | undefined> {
|
|
25
|
+
// Node is required to run the default executable
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public async createDebugAdapter(
|
|
30
|
+
session: theia.DebugSession,
|
|
31
|
+
_debugConfiguration: theia.DebugConfiguration,
|
|
32
|
+
executable: theia.DebugAdapterExecutable | undefined,
|
|
33
|
+
descriptorFactory: theia.DebugAdapterDescriptorFactory | undefined
|
|
34
|
+
): Promise<DebugAdapter> {
|
|
35
|
+
if (descriptorFactory) {
|
|
36
|
+
const descriptor = await descriptorFactory.createDebugAdapterDescriptor(session, executable);
|
|
37
|
+
if (descriptor) {
|
|
38
|
+
if (DebugAdapterInlineImplementation.is(descriptor)) {
|
|
39
|
+
return this.connectInlineDebugAdapter(descriptor);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
throw new Error('It is not possible to provide debug adapter executable.');
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
public connectInlineDebugAdapter(adapter: DebugAdapterInlineImplementation): InlineDebugAdapter {
|
|
48
|
+
return new InlineDebugAdapter(adapter.implementation);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { DebugAdapterSessionImpl } from '@theia/debug/lib/
|
|
17
|
+
import { DebugAdapterSessionImpl } from '@theia/debug/lib/common/debug-adapter-session';
|
|
18
18
|
import * as theia from '@theia/plugin';
|
|
19
|
-
import { DebugAdapter } from '@theia/debug/lib/
|
|
20
|
-
import {
|
|
19
|
+
import { DebugAdapter } from '@theia/debug/lib/common/debug-model';
|
|
20
|
+
import { DebugChannel } from '@theia/debug/lib/common/debug-service';
|
|
21
21
|
|
|
22
22
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
23
23
|
|
|
@@ -43,7 +43,7 @@ export class PluginDebugAdapterSession extends DebugAdapterSessionImpl {
|
|
|
43
43
|
this.configuration = theiaSession.configuration;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
override async start(channel:
|
|
46
|
+
override async start(channel: DebugChannel): Promise<void> {
|
|
47
47
|
if (this.tracker.onWillStartSession) {
|
|
48
48
|
this.tracker.onWillStartSession();
|
|
49
49
|
}
|
|
File without changes
|
|
@@ -24,9 +24,10 @@ export function serializeEnterRules(rules?: theia.OnEnterRule[]): SerializedOnEn
|
|
|
24
24
|
|
|
25
25
|
return rules.map(r =>
|
|
26
26
|
({
|
|
27
|
-
action: r.action,
|
|
28
27
|
beforeText: serializeRegExp(r.beforeText),
|
|
29
|
-
afterText: serializeRegExp(r.afterText)
|
|
28
|
+
afterText: serializeRegExp(r.afterText),
|
|
29
|
+
previousLineText: serializeRegExp(r.previousLineText),
|
|
30
|
+
action: r.action,
|
|
30
31
|
} as SerializedOnEnterRule));
|
|
31
32
|
}
|
|
32
33
|
|