@theia/plugin-ext 1.75.0-next.3 → 1.75.0-next.34
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/errors.d.ts +1 -14
- package/lib/common/errors.d.ts.map +1 -1
- package/lib/common/errors.js +3 -16
- package/lib/common/errors.js.map +1 -1
- package/lib/common/plugin-api-rpc.d.ts +1 -1
- package/lib/common/plugin-api-rpc.d.ts.map +1 -1
- package/lib/common/plugin-protocol.d.ts +53 -648
- package/lib/common/plugin-protocol.d.ts.map +1 -1
- package/lib/common/plugin-protocol.js +11 -34
- package/lib/common/plugin-protocol.js.map +1 -1
- package/lib/hosted/browser/hosted-plugin.d.ts +2 -1
- package/lib/hosted/browser/hosted-plugin.d.ts.map +1 -1
- package/lib/hosted/browser/hosted-plugin.js +8 -3
- package/lib/hosted/browser/hosted-plugin.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 +5 -36
- package/lib/hosted/browser/worker/plugin-manifest-loader.js.map +1 -1
- package/lib/hosted/browser/worker/worker-main.js +2 -1
- package/lib/hosted/browser/worker/worker-main.js.map +1 -1
- package/lib/hosted/common/hosted-plugin.js +10 -9
- package/lib/hosted/common/hosted-plugin.js.map +1 -1
- package/lib/hosted/common/hosted-plugin.spec.js +2 -0
- package/lib/hosted/common/hosted-plugin.spec.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-localization-service.d.ts.map +1 -1
- package/lib/hosted/node/hosted-plugin-localization-service.js +4 -68
- package/lib/hosted/node/hosted-plugin-localization-service.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-process.js +1 -0
- package/lib/hosted/node/hosted-plugin-process.js.map +1 -1
- package/lib/hosted/node/hosted-plugin.js +1 -0
- package/lib/hosted/node/hosted-plugin.js.map +1 -1
- package/lib/hosted/node/plugin-host-rpc.d.ts.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-reader.d.ts.map +1 -1
- package/lib/hosted/node/plugin-reader.js +6 -4
- package/lib/hosted/node/plugin-reader.js.map +1 -1
- package/lib/hosted/node/plugin-service.js +1 -0
- package/lib/hosted/node/plugin-service.js.map +1 -1
- package/lib/hosted/node/scanners/grammars-reader.d.ts +3 -2
- package/lib/hosted/node/scanners/grammars-reader.d.ts.map +1 -1
- package/lib/hosted/node/scanners/grammars-reader.js +5 -23
- package/lib/hosted/node/scanners/grammars-reader.js.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.d.ts +38 -71
- package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.js +117 -768
- package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.spec.js +191 -0
- package/lib/hosted/node/scanners/scanner-theia.spec.js.map +1 -1
- package/lib/main/browser/comments/comments-service.d.ts +2 -0
- package/lib/main/browser/comments/comments-service.d.ts.map +1 -1
- package/lib/main/browser/comments/comments-service.js +7 -1
- package/lib/main/browser/comments/comments-service.js.map +1 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts +2 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js +6 -1
- package/lib/main/browser/custom-editors/plugin-custom-editor-registry.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-contribution-registry.d.ts +2 -0
- package/lib/main/browser/debug/plugin-debug-session-contribution-registry.d.ts.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-contribution-registry.js +7 -1
- package/lib/main/browser/debug/plugin-debug-session-contribution-registry.js.map +1 -1
- package/lib/main/browser/menus/menus-contribution-handler.d.ts +2 -1
- package/lib/main/browser/menus/menus-contribution-handler.d.ts.map +1 -1
- package/lib/main/browser/menus/menus-contribution-handler.js +9 -4
- package/lib/main/browser/menus/menus-contribution-handler.js.map +1 -1
- package/lib/main/browser/plugin-contribution-handler.js +1 -1
- package/lib/main/browser/plugin-contribution-handler.js.map +1 -1
- package/lib/main/browser/plugin-icon-service.d.ts.map +1 -1
- package/lib/main/browser/plugin-icon-service.js +2 -1
- package/lib/main/browser/plugin-icon-service.js.map +1 -1
- package/lib/main/browser/plugin-icon-theme-service.d.ts.map +1 -1
- package/lib/main/browser/plugin-icon-theme-service.js +2 -1
- package/lib/main/browser/plugin-icon-theme-service.js.map +1 -1
- package/lib/main/browser/plugin-shared-style.d.ts.map +1 -1
- package/lib/main/browser/plugin-shared-style.js +2 -1
- package/lib/main/browser/plugin-shared-style.js.map +1 -1
- package/lib/main/browser/scm-main.d.ts.map +1 -1
- package/lib/main/browser/scm-main.js +3 -1
- package/lib/main/browser/scm-main.js.map +1 -1
- package/lib/main/browser/text-editor-model-service.d.ts +2 -1
- package/lib/main/browser/text-editor-model-service.d.ts.map +1 -1
- package/lib/main/browser/text-editor-model-service.js +6 -1
- package/lib/main/browser/text-editor-model-service.js.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.d.ts +2 -0
- package/lib/main/browser/view/plugin-view-registry.d.ts.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.js +14 -9
- package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
- package/lib/main/browser/view/tree-view-widget.d.ts +3 -0
- package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
- package/lib/main/browser/view/tree-view-widget.js +17 -6
- package/lib/main/browser/view/tree-view-widget.js.map +1 -1
- package/lib/main/browser/webview/webview.d.ts.map +1 -1
- package/lib/main/browser/webview/webview.js +4 -2
- package/lib/main/browser/webview/webview.js.map +1 -1
- package/lib/main/browser/webview-views/webview-views-main.d.ts.map +1 -1
- package/lib/main/browser/webview-views/webview-views-main.js +3 -2
- package/lib/main/browser/webview-views/webview-views-main.js.map +1 -1
- package/lib/main/node/handlers/plugin-theia-directory-handler.d.ts +2 -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 +10 -4
- package/lib/main/node/handlers/plugin-theia-directory-handler.js.map +1 -1
- package/lib/main/node/handlers/plugin-theia-file-handler.d.ts +2 -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 +9 -3
- package/lib/main/node/handlers/plugin-theia-file-handler.js.map +1 -1
- package/lib/main/node/paths/plugin-paths-service.js +1 -0
- package/lib/main/node/paths/plugin-paths-service.js.map +1 -1
- package/lib/main/node/plugin-deployer-contribution.js +1 -0
- package/lib/main/node/plugin-deployer-contribution.js.map +1 -1
- package/lib/main/node/plugin-deployer-impl.d.ts.map +1 -1
- package/lib/main/node/plugin-deployer-impl.js +16 -13
- package/lib/main/node/plugin-deployer-impl.js.map +1 -1
- package/lib/main/node/plugin-service.d.ts +2 -0
- package/lib/main/node/plugin-service.d.ts.map +1 -1
- package/lib/main/node/plugin-service.js +7 -1
- package/lib/main/node/plugin-service.js.map +1 -1
- package/lib/main/node/plugin-uninstallation-manager.d.ts +2 -1
- package/lib/main/node/plugin-uninstallation-manager.d.ts.map +1 -1
- package/lib/main/node/plugin-uninstallation-manager.js +6 -1
- package/lib/main/node/plugin-uninstallation-manager.js.map +1 -1
- package/lib/main/node/plugins-key-value-storage.d.ts +2 -0
- package/lib/main/node/plugins-key-value-storage.d.ts.map +1 -1
- package/lib/main/node/plugins-key-value-storage.js +9 -3
- package/lib/main/node/plugins-key-value-storage.js.map +1 -1
- package/lib/main/node/resolvers/local-plugin-deployer-resolver.d.ts +2 -0
- package/lib/main/node/resolvers/local-plugin-deployer-resolver.d.ts.map +1 -1
- package/lib/main/node/resolvers/local-plugin-deployer-resolver.js +7 -1
- package/lib/main/node/resolvers/local-plugin-deployer-resolver.js.map +1 -1
- package/lib/main/node/webview-backend-security-warnings.d.ts +2 -0
- package/lib/main/node/webview-backend-security-warnings.d.ts.map +1 -1
- package/lib/main/node/webview-backend-security-warnings.js +7 -1
- package/lib/main/node/webview-backend-security-warnings.js.map +1 -1
- package/lib/plugin/scm.js +1 -1
- package/lib/plugin/scm.js.map +1 -1
- package/package.json +31 -30
- package/src/common/errors.ts +1 -25
- package/src/common/plugin-api-rpc.ts +1 -1
- package/src/common/plugin-protocol.ts +203 -662
- package/src/hosted/browser/hosted-plugin.ts +8 -5
- package/src/hosted/browser/worker/plugin-manifest-loader.ts +8 -41
- package/src/hosted/browser/worker/worker-main.ts +2 -1
- package/src/hosted/common/hosted-plugin.spec.ts +2 -0
- package/src/hosted/common/hosted-plugin.ts +10 -10
- package/src/hosted/node/hosted-plugin-localization-service.ts +3 -82
- package/src/hosted/node/hosted-plugin-process.ts +1 -1
- package/src/hosted/node/hosted-plugin.ts +2 -2
- package/src/hosted/node/plugin-host-rpc.ts +3 -3
- package/src/hosted/node/plugin-reader.ts +7 -6
- package/src/hosted/node/plugin-service.ts +1 -1
- package/src/hosted/node/scanners/grammars-reader.ts +14 -23
- package/src/hosted/node/scanners/scanner-theia.spec.ts +225 -1
- package/src/hosted/node/scanners/scanner-theia.ts +204 -881
- package/src/main/browser/comments/comments-service.ts +6 -2
- package/src/main/browser/custom-editors/plugin-custom-editor-registry.ts +6 -3
- package/src/main/browser/debug/plugin-debug-session-contribution-registry.ts +5 -1
- package/src/main/browser/menus/menus-contribution-handler.ts +9 -6
- package/src/main/browser/plugin-contribution-handler.ts +1 -1
- package/src/main/browser/plugin-icon-service.ts +2 -1
- package/src/main/browser/plugin-icon-theme-service.ts +2 -1
- package/src/main/browser/plugin-shared-style.ts +2 -1
- package/src/main/browser/scm-main.ts +3 -1
- package/src/main/browser/text-editor-model-service.ts +6 -3
- package/src/main/browser/view/plugin-view-registry.ts +14 -11
- package/src/main/browser/view/tree-view-widget.tsx +14 -7
- package/src/main/browser/webview/webview.ts +4 -2
- package/src/main/browser/webview-views/webview-views-main.ts +4 -4
- package/src/main/node/handlers/plugin-theia-directory-handler.ts +9 -6
- package/src/main/node/handlers/plugin-theia-file-handler.ts +8 -5
- package/src/main/node/paths/plugin-paths-service.ts +2 -2
- package/src/main/node/plugin-deployer-contribution.ts +2 -2
- package/src/main/node/plugin-deployer-impl.ts +20 -14
- package/src/main/node/plugin-service.ts +6 -2
- package/src/main/node/plugin-uninstallation-manager.ts +7 -4
- package/src/main/node/plugins-key-value-storage.ts +8 -4
- package/src/main/node/resolvers/local-plugin-deployer-resolver.ts +7 -2
- package/src/main/node/webview-backend-security-warnings.ts +6 -2
- package/src/plugin/scm.ts +1 -1
- package/lib/hosted/node/plugin-activation-events.d.ts +0 -7
- package/lib/hosted/node/plugin-activation-events.d.ts.map +0 -1
- package/lib/hosted/node/plugin-activation-events.js +0 -95
- package/lib/hosted/node/plugin-activation-events.js.map +0 -1
- package/lib/hosted/node/plugin-manifest-loader.d.ts +0 -3
- package/lib/hosted/node/plugin-manifest-loader.d.ts.map +0 -1
- package/lib/hosted/node/plugin-manifest-loader.js +0 -34
- package/lib/hosted/node/plugin-manifest-loader.js.map +0 -1
- package/lib/main/node/errors.spec.d.ts +0 -2
- package/lib/main/node/errors.spec.d.ts.map +0 -1
- package/lib/main/node/errors.spec.js +0 -36
- package/lib/main/node/errors.spec.js.map +0 -1
- package/src/hosted/node/plugin-activation-events.ts +0 -112
- package/src/hosted/node/plugin-manifest-loader.ts +0 -32
- package/src/main/node/errors.spec.ts +0 -37
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { injectable } from '@theia/core/shared/inversify';
|
|
17
|
+
import { injectable, inject, named } from '@theia/core/shared/inversify';
|
|
18
18
|
import { URI } from '@theia/core/shared/vscode-uri';
|
|
19
19
|
import { Event, Emitter } from '@theia/core/lib/common/event';
|
|
20
20
|
import {
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
} from '../../../common/plugin-api-rpc-model';
|
|
28
28
|
import { CommentController } from './comments-main';
|
|
29
29
|
import { CancellationToken } from '@theia/core/lib/common/cancellation';
|
|
30
|
+
import { ILogger } from '@theia/core';
|
|
30
31
|
|
|
31
32
|
/*---------------------------------------------------------------------------------------------
|
|
32
33
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -90,6 +91,9 @@ export interface CommentsService {
|
|
|
90
91
|
@injectable()
|
|
91
92
|
export class PluginCommentService implements CommentsService {
|
|
92
93
|
|
|
94
|
+
@inject(ILogger) @named('plugin-ext:PluginCommentService')
|
|
95
|
+
protected readonly logger: ILogger;
|
|
96
|
+
|
|
93
97
|
private readonly onDidSetDataProviderEmitter: Emitter<void> = new Emitter<void>();
|
|
94
98
|
readonly onDidSetDataProvider: Event<void> = this.onDidSetDataProviderEmitter.event;
|
|
95
99
|
|
|
@@ -181,7 +185,7 @@ export class PluginCommentService implements CommentsService {
|
|
|
181
185
|
this.commentControls.forEach(control => {
|
|
182
186
|
commentControlResult.push(control.getDocumentComments(resource, CancellationToken.None)
|
|
183
187
|
.catch(e => {
|
|
184
|
-
|
|
188
|
+
this.logger.info(e);
|
|
185
189
|
return null;
|
|
186
190
|
}));
|
|
187
191
|
});
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
|
|
17
|
+
import { injectable, inject, postConstruct, named } from '@theia/core/shared/inversify';
|
|
18
18
|
import { CustomEditor, DeployedPlugin } from '../../../common';
|
|
19
19
|
import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposable';
|
|
20
20
|
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
21
21
|
import { CustomEditorOpener } from './custom-editor-opener';
|
|
22
|
-
import { Emitter, PreferenceService } from '@theia/core';
|
|
22
|
+
import { Emitter, PreferenceService, ILogger } from '@theia/core';
|
|
23
23
|
import { ApplicationShell, DefaultOpenerService, OpenWithService, WidgetManager } from '@theia/core/lib/browser';
|
|
24
24
|
import { CustomEditorWidget } from './custom-editor-widget';
|
|
25
25
|
|
|
@@ -47,6 +47,9 @@ export class PluginCustomEditorRegistry {
|
|
|
47
47
|
@inject(PreferenceService)
|
|
48
48
|
protected readonly preferenceService: PreferenceService;
|
|
49
49
|
|
|
50
|
+
@inject(ILogger) @named('plugin-ext:PluginCustomEditorRegistry')
|
|
51
|
+
protected readonly logger: ILogger;
|
|
52
|
+
|
|
50
53
|
@postConstruct()
|
|
51
54
|
protected init(): void {
|
|
52
55
|
this.widgetManager.onDidCreateWidget(({ factoryId, widget }) => {
|
|
@@ -67,7 +70,7 @@ export class PluginCustomEditorRegistry {
|
|
|
67
70
|
|
|
68
71
|
registerCustomEditor(editor: CustomEditor, plugin: DeployedPlugin): Disposable {
|
|
69
72
|
if (this.editors.has(editor.viewType)) {
|
|
70
|
-
|
|
73
|
+
this.logger.warn('editor with such id already registered: ', JSON.stringify(editor));
|
|
71
74
|
return Disposable.NULL;
|
|
72
75
|
}
|
|
73
76
|
this.editors.set(editor.viewType, editor);
|
|
@@ -18,6 +18,7 @@ import { DebugSessionContributionRegistry, DebugSessionContribution } from '@the
|
|
|
18
18
|
import { injectable, inject, named, postConstruct } from '@theia/core/shared/inversify';
|
|
19
19
|
import { ContributionProvider } from '@theia/core/lib/common/contribution-provider';
|
|
20
20
|
import { Disposable } from '@theia/core/lib/common/disposable';
|
|
21
|
+
import { ILogger } from '@theia/core';
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* Debug session contribution registrator.
|
|
@@ -47,6 +48,9 @@ export class PluginDebugSessionContributionRegistry implements DebugSessionContr
|
|
|
47
48
|
@inject(ContributionProvider) @named(DebugSessionContribution)
|
|
48
49
|
protected readonly contributions: ContributionProvider<DebugSessionContribution>;
|
|
49
50
|
|
|
51
|
+
@inject(ILogger) @named('plugin-ext:PluginDebugSessionContributionRegistry')
|
|
52
|
+
protected readonly logger: ILogger;
|
|
53
|
+
|
|
50
54
|
@postConstruct()
|
|
51
55
|
protected init(): void {
|
|
52
56
|
for (const contrib of this.contributions.getContributions()) {
|
|
@@ -62,7 +66,7 @@ export class PluginDebugSessionContributionRegistry implements DebugSessionContr
|
|
|
62
66
|
const { debugType } = contrib;
|
|
63
67
|
|
|
64
68
|
if (this.contribs.has(debugType)) {
|
|
65
|
-
|
|
69
|
+
this.logger.warn(`Debug session contribution already registered for ${debugType}`);
|
|
66
70
|
return Disposable.NULL;
|
|
67
71
|
}
|
|
68
72
|
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
18
18
|
|
|
19
|
-
import { inject, injectable, optional } from '@theia/core/shared/inversify';
|
|
20
|
-
import { MenuPath, CommandRegistry, Disposable, DisposableCollection, nls, CommandMenu, AcceleratorSource, ContextExpressionMatcher, environment } from '@theia/core';
|
|
19
|
+
import { inject, injectable, optional, named } from '@theia/core/shared/inversify';
|
|
20
|
+
import { MenuPath, CommandRegistry, Disposable, DisposableCollection, nls, CommandMenu, AcceleratorSource, ContextExpressionMatcher, environment, ILogger } from '@theia/core';
|
|
21
21
|
import { MenuModelRegistry } from '@theia/core/lib/common';
|
|
22
22
|
import { TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
23
23
|
import { DeployedPlugin, IconUrl, Menu } from '../../../common';
|
|
@@ -48,6 +48,9 @@ export class MenusContributionPointHandler {
|
|
|
48
48
|
@inject(QuickCommandService) @optional()
|
|
49
49
|
private readonly quickCommandService: QuickCommandService;
|
|
50
50
|
|
|
51
|
+
@inject(ILogger) @named('plugin-ext:MenusContributionPointHandler')
|
|
52
|
+
protected readonly logger: ILogger;
|
|
53
|
+
|
|
51
54
|
private initialized = false;
|
|
52
55
|
private initialize(): void {
|
|
53
56
|
this.initialized = true;
|
|
@@ -100,7 +103,7 @@ export class MenusContributionPointHandler {
|
|
|
100
103
|
const { group, order } = this.parseGroup(item.group);
|
|
101
104
|
const { submenu, command } = item;
|
|
102
105
|
if (submenu && command) {
|
|
103
|
-
|
|
106
|
+
this.logger.warn(
|
|
104
107
|
`Menu item ${command} from plugin ${plugin.metadata.model.id} contributed both submenu and command. Only command will be registered.`
|
|
105
108
|
);
|
|
106
109
|
}
|
|
@@ -111,7 +114,7 @@ export class MenusContributionPointHandler {
|
|
|
111
114
|
|
|
112
115
|
const cmd = this.commandRegistry.getCommand(command);
|
|
113
116
|
if (!cmd) {
|
|
114
|
-
|
|
117
|
+
this.logger.debug(`No label for action menu node: No command "${command}" exists.`);
|
|
115
118
|
return;
|
|
116
119
|
}
|
|
117
120
|
const label = cmd.label || cmd.id;
|
|
@@ -159,8 +162,8 @@ export class MenusContributionPointHandler {
|
|
|
159
162
|
}
|
|
160
163
|
}
|
|
161
164
|
} catch (error) {
|
|
162
|
-
|
|
163
|
-
|
|
165
|
+
this.logger.warn(`Failed to register a menu item for plugin ${plugin.metadata.model.id} contributed to ${contributionPoint}`, item);
|
|
166
|
+
this.logger.debug(error);
|
|
164
167
|
}
|
|
165
168
|
}
|
|
166
169
|
}
|
|
@@ -277,7 +277,7 @@ export class PluginContributionHandler {
|
|
|
277
277
|
embeddedLanguages: this.convertEmbeddedLanguages(grammar.embeddedLanguages, logWarning),
|
|
278
278
|
tokenTypes: this.convertTokenTypes(grammar.tokenTypes),
|
|
279
279
|
balancedBracketSelectors: grammar.balancedBracketScopes ?? ['*'],
|
|
280
|
-
unbalancedBracketSelectors: grammar.
|
|
280
|
+
unbalancedBracketSelectors: grammar.unbalancedBracketScopes ?? [],
|
|
281
281
|
}));
|
|
282
282
|
}
|
|
283
283
|
// activate grammars only once everything else is loaded.
|
|
@@ -21,6 +21,7 @@ import { URI } from '@theia/core/shared/vscode-uri';
|
|
|
21
21
|
import { MonacoIconRegistry } from '@theia/monaco/lib/browser/monaco-icon-registry';
|
|
22
22
|
import * as path from 'path';
|
|
23
23
|
import { IconContribution, DeployedPlugin, IconDefinition } from '../../common/plugin-protocol';
|
|
24
|
+
import { PLUGINS_BASE_PATH } from '@theia/plugin-utils/lib/common/constants';
|
|
24
25
|
|
|
25
26
|
@injectable()
|
|
26
27
|
export class PluginIconService implements Disposable {
|
|
@@ -68,7 +69,7 @@ export class PluginIconService implements Disposable {
|
|
|
68
69
|
|
|
69
70
|
protected toPluginUrl(id: string, relativePath: string): URI {
|
|
70
71
|
return URI.from(new Endpoint({
|
|
71
|
-
path:
|
|
72
|
+
path: `${PLUGINS_BASE_PATH}/${this.formatExtensionId(id)}/${encodeURIComponent(relativePath)}`
|
|
72
73
|
}).getRestUrl().toComponents());
|
|
73
74
|
}
|
|
74
75
|
|
|
@@ -25,6 +25,7 @@ import * as jsoncparser from 'jsonc-parser';
|
|
|
25
25
|
import { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
|
|
26
26
|
import { IconThemeService, IconTheme, IconThemeDefinition } from '@theia/core/lib/browser/icon-theme-service';
|
|
27
27
|
import { IconThemeContribution, DeployedPlugin, UiTheme, getPluginId } from '../../common/plugin-protocol';
|
|
28
|
+
import { PLUGINS_BASE_PATH } from '@theia/plugin-utils/lib/common/constants';
|
|
28
29
|
import URI from '@theia/core/lib/common/uri';
|
|
29
30
|
import { Disposable, DisposableCollection } from '@theia/core/lib/common/disposable';
|
|
30
31
|
import { Emitter } from '@theia/core/lib/common/event';
|
|
@@ -363,7 +364,7 @@ export class PluginIconTheme extends PluginIconThemeDefinition implements IconTh
|
|
|
363
364
|
const iconUri = this.locationUri.resolve(iconPath);
|
|
364
365
|
const relativePath = this.packageRootUri.path.relative(iconUri.path.normalize());
|
|
365
366
|
return relativePath && `url('${new Endpoint({
|
|
366
|
-
path:
|
|
367
|
+
path: `${PLUGINS_BASE_PATH}/${this.pluginId}/${encodeURIComponent(relativePath.normalize().toString())}`
|
|
367
368
|
}).getRestUrl().toString()}')`;
|
|
368
369
|
}
|
|
369
370
|
|
|
@@ -21,6 +21,7 @@ import { Theme } from '@theia/core/lib/common/theme';
|
|
|
21
21
|
import { IconUrl } from '../../common/plugin-protocol';
|
|
22
22
|
import { Reference, SyncReferenceCollection } from '@theia/core/lib/common/reference';
|
|
23
23
|
import { Endpoint } from '@theia/core/lib/browser/endpoint';
|
|
24
|
+
import { PLUGINS_BASE_PATH } from '@theia/plugin-utils/lib/common/constants';
|
|
24
25
|
|
|
25
26
|
export interface PluginIconKey {
|
|
26
27
|
url: IconUrl;
|
|
@@ -145,7 +146,7 @@ export class PluginSharedStyle {
|
|
|
145
146
|
}
|
|
146
147
|
|
|
147
148
|
static toExternalIconUrl(iconUrl: string): string {
|
|
148
|
-
if (iconUrl.startsWith(
|
|
149
|
+
if (iconUrl.startsWith(`${PLUGINS_BASE_PATH}/`)) {
|
|
149
150
|
return new Endpoint({ path: iconUrl }).getRestUrl().toString();
|
|
150
151
|
}
|
|
151
152
|
return iconUrl;
|
|
@@ -138,7 +138,9 @@ function historyItemFromDto(dto: ScmHistoryItemDto): ScmHistoryItem {
|
|
|
138
138
|
'light' in dto.authorIcon ? vscodeURI.revive(dto.authorIcon.light).toString() : vscodeURI.revive(dto.authorIcon as UriComponents).toString()) : undefined,
|
|
139
139
|
displayId: dto.displayId,
|
|
140
140
|
timestamp: dto.timestamp,
|
|
141
|
-
|
|
141
|
+
// Passed through as-is so that the provider's own links, commands and `isTrusted`
|
|
142
|
+
// declaration survive; flattening to `value` would strip the command allow-list.
|
|
143
|
+
tooltip: dto.tooltip,
|
|
142
144
|
statistics: dto.statistics ? {
|
|
143
145
|
files: dto.statistics.files,
|
|
144
146
|
insertions: dto.statistics.insertions,
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
//
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
|
-
import { Event, Emitter, ListenerList, Listener } from '@theia/core';
|
|
16
|
+
import { Event, Emitter, ListenerList, Listener, ILogger } from '@theia/core';
|
|
17
17
|
import { MonacoEditorModel, WillSaveMonacoModelEvent } from '@theia/monaco/lib/browser/monaco-editor-model';
|
|
18
|
-
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
18
|
+
import { injectable, inject, named } from '@theia/core/shared/inversify';
|
|
19
19
|
import { MonacoTextModelService } from '@theia/monaco/lib/browser/monaco-text-model-service';
|
|
20
20
|
import { MonacoWorkspace } from '@theia/monaco/lib/browser/monaco-workspace';
|
|
21
21
|
import { Schemes } from '../../common/uri-components';
|
|
@@ -40,6 +40,9 @@ export class EditorModelService {
|
|
|
40
40
|
readonly onModelModeChanged = this.modelModeChangedEmitter.event;
|
|
41
41
|
readonly onModelRemoved = this.onModelRemovedEmitter.event;
|
|
42
42
|
|
|
43
|
+
@inject(ILogger) @named('plugin-ext:EditorModelService')
|
|
44
|
+
protected readonly logger: ILogger;
|
|
45
|
+
|
|
43
46
|
constructor(@inject(MonacoTextModelService) monacoModelService: MonacoTextModelService,
|
|
44
47
|
@inject(MonacoWorkspace) monacoWorkspace: MonacoWorkspace) {
|
|
45
48
|
|
|
@@ -102,7 +105,7 @@ export class EditorModelService {
|
|
|
102
105
|
await model.save();
|
|
103
106
|
return true;
|
|
104
107
|
} catch (e) {
|
|
105
|
-
|
|
108
|
+
this.logger.error('Failed to save ', uri.toString(), e);
|
|
106
109
|
return false;
|
|
107
110
|
}
|
|
108
111
|
})());
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { injectable, inject, postConstruct, optional } from '@theia/core/shared/inversify';
|
|
17
|
+
import { injectable, inject, postConstruct, optional, named } from '@theia/core/shared/inversify';
|
|
18
18
|
import {
|
|
19
19
|
ApplicationShell, ViewContainer as ViewContainerWidget, WidgetManager, QuickViewService,
|
|
20
20
|
ViewContainerIdentifier, ViewContainerTitleOptions, Widget, FrontendApplicationContribution,
|
|
@@ -47,7 +47,7 @@ import { WebviewView, WebviewViewResolver } from '../webview-views/webview-views
|
|
|
47
47
|
import { WebviewWidget, WebviewWidgetIdentifier } from '../webview/webview';
|
|
48
48
|
import { CancellationToken } from '@theia/core/lib/common/cancellation';
|
|
49
49
|
import { generateUuid } from '@theia/core/lib/common/uuid';
|
|
50
|
-
import { nls } from '@theia/core';
|
|
50
|
+
import { nls, ILogger } from '@theia/core';
|
|
51
51
|
import { TheiaDockPanel } from '@theia/core/lib/browser/shell/theia-dock-panel';
|
|
52
52
|
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
53
53
|
import { ThemeIcon } from '@theia/monaco-editor-core/esm/vs/base/common/themables';
|
|
@@ -102,6 +102,9 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
|
|
|
102
102
|
@inject(ViewContextKeyService)
|
|
103
103
|
protected readonly viewContextKeys: ViewContextKeyService;
|
|
104
104
|
|
|
105
|
+
@inject(ILogger) @named('plugin-ext:PluginViewRegistry')
|
|
106
|
+
protected readonly logger: ILogger;
|
|
107
|
+
|
|
105
108
|
protected readonly onDidExpandViewEmitter = new Emitter<string>();
|
|
106
109
|
readonly onDidExpandView = this.onDidExpandViewEmitter.event;
|
|
107
110
|
|
|
@@ -312,7 +315,7 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
|
|
|
312
315
|
registerViewContainer(location: string, viewContainer: ViewContainer): Disposable {
|
|
313
316
|
const containerId = `workbench.view.extension.${viewContainer.id}`;
|
|
314
317
|
if (this.viewContainers.has(containerId)) {
|
|
315
|
-
|
|
318
|
+
this.logger.warn('view container such id already registered: ', JSON.stringify(viewContainer));
|
|
316
319
|
return Disposable.NULL;
|
|
317
320
|
}
|
|
318
321
|
const toDispose = new DisposableCollection();
|
|
@@ -521,7 +524,7 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
|
|
|
521
524
|
viewContainerId = `workbench.view.extension.${viewContainerId}`;
|
|
522
525
|
}
|
|
523
526
|
if (this.views.has(view.id)) {
|
|
524
|
-
|
|
527
|
+
this.logger.warn('view with such id already registered: ', JSON.stringify(view));
|
|
525
528
|
return Disposable.NULL;
|
|
526
529
|
}
|
|
527
530
|
const toDispose = new DisposableCollection();
|
|
@@ -922,39 +925,39 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
|
|
|
922
925
|
for (const id of this.viewContainers.keys()) {
|
|
923
926
|
promises.push((async () => {
|
|
924
927
|
await this.initViewContainer(id);
|
|
925
|
-
})().catch(
|
|
928
|
+
})().catch(e => this.logger.error(e)));
|
|
926
929
|
}
|
|
927
930
|
promises.push((async () => {
|
|
928
931
|
const explorer = await this.widgetManager.getWidget(EXPLORER_VIEW_CONTAINER_ID);
|
|
929
932
|
if (explorer instanceof ViewContainerWidget) {
|
|
930
933
|
await this.prepareViewContainer('explorer', explorer);
|
|
931
934
|
}
|
|
932
|
-
})().catch(
|
|
935
|
+
})().catch(e => this.logger.error(e)));
|
|
933
936
|
promises.push((async () => {
|
|
934
937
|
const scm = await this.widgetManager.getWidget(SCM_VIEW_CONTAINER_ID);
|
|
935
938
|
if (scm instanceof ViewContainerWidget) {
|
|
936
939
|
await this.prepareViewContainer('scm', scm);
|
|
937
940
|
}
|
|
938
|
-
})().catch(
|
|
941
|
+
})().catch(e => this.logger.error(e)));
|
|
939
942
|
promises.push((async () => {
|
|
940
943
|
const search = await this.widgetManager.getWidget(SEARCH_VIEW_CONTAINER_ID);
|
|
941
944
|
if (search instanceof ViewContainerWidget) {
|
|
942
945
|
await this.prepareViewContainer('search', search);
|
|
943
946
|
}
|
|
944
|
-
})().catch(
|
|
947
|
+
})().catch(e => this.logger.error(e)));
|
|
945
948
|
promises.push((async () => {
|
|
946
949
|
const test = await this.widgetManager.getWidget(TEST_VIEW_CONTAINER_ID);
|
|
947
950
|
if (test instanceof ViewContainerWidget) {
|
|
948
951
|
await this.prepareViewContainer('test', test);
|
|
949
952
|
}
|
|
950
|
-
})().catch(
|
|
953
|
+
})().catch(e => this.logger.error(e)));
|
|
951
954
|
promises.push((async () => {
|
|
952
955
|
const debug = await this.widgetManager.getWidget(DebugWidget.ID);
|
|
953
956
|
if (debug instanceof DebugWidget) {
|
|
954
957
|
const viewContainer = debug['sessionWidget']['viewContainer'];
|
|
955
958
|
await this.prepareViewContainer('debug', viewContainer);
|
|
956
959
|
}
|
|
957
|
-
})().catch(
|
|
960
|
+
})().catch(e => this.logger.error(e)));
|
|
958
961
|
await Promise.all(promises);
|
|
959
962
|
}
|
|
960
963
|
|
|
@@ -1016,7 +1019,7 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
|
|
|
1016
1019
|
|
|
1017
1020
|
registerViewDataProvider(viewId: string, provider: ViewDataProvider): Disposable {
|
|
1018
1021
|
if (this.viewDataProviders.has(viewId)) {
|
|
1019
|
-
|
|
1022
|
+
this.logger.error(`data provider for '${viewId}' view is already registered`);
|
|
1020
1023
|
return Disposable.NULL;
|
|
1021
1024
|
}
|
|
1022
1025
|
this.viewDataProviders.set(viewId, provider);
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
|
|
17
|
+
import { injectable, inject, postConstruct, named } from '@theia/core/shared/inversify';
|
|
18
18
|
import { TreeViewsExt, TreeViewItemCollapsibleState, TreeViewItem, TreeViewItemReference, ThemeIcon, DataTransferFileDTO } from '../../../common/plugin-api-rpc';
|
|
19
19
|
import { Command } from '../../../common/plugin-api-rpc-model';
|
|
20
20
|
import {
|
|
@@ -53,6 +53,7 @@ import { CancellationTokenSource, CancellationToken, Mutable } from '@theia/core
|
|
|
53
53
|
import { mixin } from '../../../common/types';
|
|
54
54
|
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
55
55
|
import { DnDFileContentStore } from './dnd-file-content-store';
|
|
56
|
+
import { ILogger } from '@theia/core';
|
|
56
57
|
|
|
57
58
|
export const TREE_NODE_HYPERLINK = 'theia-TreeNodeHyperlink';
|
|
58
59
|
export const VIEW_ITEM_CONTEXT_MENU: MenuPath = ['view-item-context-menu'];
|
|
@@ -183,6 +184,9 @@ export class PluginTree extends TreeImpl {
|
|
|
183
184
|
@inject(MessageService)
|
|
184
185
|
protected readonly notification: MessageService;
|
|
185
186
|
|
|
187
|
+
@inject(ILogger) @named('plugin-ext:PluginTree')
|
|
188
|
+
protected override readonly logger: ILogger;
|
|
189
|
+
|
|
186
190
|
protected readonly onDidChangeWelcomeStateEmitter: Emitter<void> = new Emitter<void>();
|
|
187
191
|
readonly onDidChangeWelcomeState = this.onDidChangeWelcomeStateEmitter.event;
|
|
188
192
|
|
|
@@ -235,7 +239,7 @@ export class PluginTree extends TreeImpl {
|
|
|
235
239
|
return children || [];
|
|
236
240
|
} catch (e) {
|
|
237
241
|
if (e) {
|
|
238
|
-
|
|
242
|
+
this.logger.error(`Failed to fetch children for '${this.options.id}'`, e);
|
|
239
243
|
const label = this._viewInfo ? this._viewInfo.name : this.options.id;
|
|
240
244
|
this.notification.error(`${label}: ${e.message}`);
|
|
241
245
|
}
|
|
@@ -473,6 +477,9 @@ export class TreeViewWidget extends TreeViewWelcomeWidget {
|
|
|
473
477
|
@inject(DnDFileContentStore)
|
|
474
478
|
protected readonly dndFileContentStore: DnDFileContentStore;
|
|
475
479
|
|
|
480
|
+
@inject(ILogger) @named('plugin-ext:TreeViewWidget')
|
|
481
|
+
protected readonly logger: ILogger;
|
|
482
|
+
|
|
476
483
|
protected treeDragType: string;
|
|
477
484
|
protected readonly expansionTimeouts: Map<string, number> = new Map();
|
|
478
485
|
|
|
@@ -633,17 +640,17 @@ export class TreeViewWidget extends TreeViewWelcomeWidget {
|
|
|
633
640
|
handleDragLeave(node: TreeViewNode, event: React.DragEvent<HTMLElement>): void {
|
|
634
641
|
const timeout = this.expansionTimeouts.get(node.id);
|
|
635
642
|
if (typeof timeout !== 'undefined') {
|
|
636
|
-
|
|
643
|
+
this.logger.debug(`dragleave ${node.id} canceling timeout`);
|
|
637
644
|
clearTimeout(timeout);
|
|
638
645
|
this.expansionTimeouts.delete(node.id);
|
|
639
646
|
}
|
|
640
647
|
}
|
|
641
648
|
handleDragEnter(node: TreeViewNode, event: React.DragEvent<HTMLElement>): void {
|
|
642
|
-
|
|
649
|
+
this.logger.debug(`dragenter ${node.id}`);
|
|
643
650
|
if (ExpandableTreeNode.is(node)) {
|
|
644
|
-
|
|
651
|
+
this.logger.debug(`dragenter ${node.id} starting timeout`);
|
|
645
652
|
this.expansionTimeouts.set(node.id, window.setTimeout(() => {
|
|
646
|
-
|
|
653
|
+
this.logger.debug(`dragenter ${node.id} timeout reached`);
|
|
647
654
|
this.model.expandNode(node);
|
|
648
655
|
}, 500));
|
|
649
656
|
}
|
|
@@ -870,7 +877,7 @@ export class TreeViewWidget extends TreeViewWelcomeWidget {
|
|
|
870
877
|
const allResolved = Promise.all(treeNodes.map(maybeNeedsResolve => {
|
|
871
878
|
if (!maybeNeedsResolve.command && maybeNeedsResolve instanceof ResolvableTreeViewNode && !maybeNeedsResolve.resolved) {
|
|
872
879
|
return maybeNeedsResolve.resolve(cancellationToken).catch(err => {
|
|
873
|
-
|
|
880
|
+
this.logger.error(`Failed to resolve tree item '${maybeNeedsResolve.id}'`, err);
|
|
874
881
|
});
|
|
875
882
|
}
|
|
876
883
|
return Promise.resolve(maybeNeedsResolve);
|
|
@@ -477,10 +477,12 @@ export class WebviewWidget extends BaseWidget implements StatefulWidget, Extract
|
|
|
477
477
|
|
|
478
478
|
protected forwardConsoleLog(log: WebviewConsoleLog): void {
|
|
479
479
|
const message = `[webview: ${this.identifier.id}] ${log.message ? JSON.parse(log.message) : undefined}`;
|
|
480
|
+
// `console.log` has no direct `ILogger` counterpart, so it is reported as `info`.
|
|
481
|
+
const level = log.level === 'log' ? 'info' : log.level;
|
|
480
482
|
if (log.optionalParams !== undefined) {
|
|
481
|
-
|
|
483
|
+
this.logger[level](message, ...JSON.parse(log.optionalParams));
|
|
482
484
|
} else {
|
|
483
|
-
|
|
485
|
+
this.logger[level](message);
|
|
484
486
|
}
|
|
485
487
|
}
|
|
486
488
|
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*--------------------------------------------------------------------------------------------*/
|
|
20
20
|
// some code copied and modified from https://github.com/microsoft/vscode/blob/e1f0f8f51390dea5df9096718fb6b647ed5a9534/src/vs/workbench/api/browser/mainThreadWebviewViews.ts
|
|
21
21
|
|
|
22
|
-
import { inject, interfaces } from '@theia/core/shared/inversify';
|
|
22
|
+
import { inject, interfaces, named } from '@theia/core/shared/inversify';
|
|
23
23
|
import { WebviewViewsMain, MAIN_RPC_CONTEXT, WebviewViewsExt } from '../../../common/plugin-api-rpc';
|
|
24
24
|
import { RPCProtocol } from '../../../common/rpc-protocol';
|
|
25
25
|
import { Disposable, DisposableCollection, ILogger } from '@theia/core';
|
|
@@ -44,7 +44,7 @@ export class WebviewViewsMainImpl implements WebviewViewsMain, Disposable {
|
|
|
44
44
|
protected readonly pluginViewRegistry: PluginViewRegistry;
|
|
45
45
|
protected readonly badgeService: BadgeService;
|
|
46
46
|
|
|
47
|
-
@inject(ILogger)
|
|
47
|
+
@inject(ILogger) @named('plugin-ext:WebviewViewsMainImpl')
|
|
48
48
|
protected readonly logger: ILogger;
|
|
49
49
|
|
|
50
50
|
constructor(rpc: RPCProtocol,
|
|
@@ -77,9 +77,9 @@ export class WebviewViewsMainImpl implements WebviewViewsMain, Disposable {
|
|
|
77
77
|
if (webviewView.webview.state) {
|
|
78
78
|
try {
|
|
79
79
|
state = JSON.parse(webviewView.webview.state);
|
|
80
|
-
|
|
80
|
+
this.logger.info(state);
|
|
81
81
|
} catch (e) {
|
|
82
|
-
|
|
82
|
+
this.logger.error('Could not load webview state', e, webviewView.webview.state);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
if (options) {
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
import * as path from 'path';
|
|
18
18
|
import * as filenamify from 'filenamify';
|
|
19
19
|
import * as fs from '@theia/core/shared/fs-extra';
|
|
20
|
-
import
|
|
21
|
-
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
20
|
+
import { URI, ILogger } from '@theia/core';
|
|
21
|
+
import { inject, injectable, named } from '@theia/core/shared/inversify';
|
|
22
22
|
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
23
23
|
import { FileUri } from '@theia/core/lib/node';
|
|
24
24
|
import {
|
|
@@ -34,6 +34,9 @@ export abstract class AbstractPluginDirectoryHandler implements PluginDeployerDi
|
|
|
34
34
|
|
|
35
35
|
@inject(PluginCliContribution) protected readonly pluginCli: PluginCliContribution;
|
|
36
36
|
|
|
37
|
+
@inject(ILogger) @named('plugin-ext:AbstractPluginDirectoryHandler')
|
|
38
|
+
protected readonly logger: ILogger;
|
|
39
|
+
|
|
37
40
|
constructor() {
|
|
38
41
|
this.deploymentDirectory = new Deferred();
|
|
39
42
|
getTempDirPathAsync('theia-copied')
|
|
@@ -42,7 +45,7 @@ export abstract class AbstractPluginDirectoryHandler implements PluginDeployerDi
|
|
|
42
45
|
|
|
43
46
|
async accept(resolvedPlugin: PluginDeployerEntry): Promise<boolean> {
|
|
44
47
|
|
|
45
|
-
|
|
48
|
+
this.logger.debug(`Plugin directory handler: accepting plugin with path ${resolvedPlugin.path()}`);
|
|
46
49
|
|
|
47
50
|
// handle only directories
|
|
48
51
|
if (await resolvedPlugin.isFile()) {
|
|
@@ -89,9 +92,9 @@ export abstract class AbstractPluginDirectoryHandler implements PluginDeployerDi
|
|
|
89
92
|
const targetDir = await this.getExtensionDir(context);
|
|
90
93
|
try {
|
|
91
94
|
if (await fs.pathExists(targetDir) || !entry.path().startsWith(origin)) {
|
|
92
|
-
|
|
95
|
+
this.logger.info(`[${id}]: already copied.`);
|
|
93
96
|
} else {
|
|
94
|
-
|
|
97
|
+
this.logger.info(`[${id}]: copying to "${targetDir}"`);
|
|
95
98
|
const deploymentDirectory = await this.deploymentDirectory.promise;
|
|
96
99
|
await fs.mkdirp(FileUri.fsPath(deploymentDirectory));
|
|
97
100
|
await context.copy(origin, targetDir);
|
|
@@ -101,7 +104,7 @@ export abstract class AbstractPluginDirectoryHandler implements PluginDeployerDi
|
|
|
101
104
|
}
|
|
102
105
|
}
|
|
103
106
|
} catch (e) {
|
|
104
|
-
|
|
107
|
+
this.logger.warn(`[${id}]: Error when copying.`, e);
|
|
105
108
|
entry.updatePath(pathToRestore);
|
|
106
109
|
}
|
|
107
110
|
}
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { PluginDeployerFileHandler, PluginDeployerEntry, PluginDeployerFileHandlerContext, PluginType } from '../../../common/plugin-protocol';
|
|
18
|
-
import
|
|
19
|
-
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
18
|
+
import { URI, ILogger } from '@theia/core';
|
|
19
|
+
import { inject, injectable, named } from '@theia/core/shared/inversify';
|
|
20
20
|
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
21
21
|
import { getTempDirPathAsync } from '../temp-dir-util';
|
|
22
22
|
import * as fs from '@theia/core/shared/fs-extra';
|
|
@@ -32,6 +32,9 @@ export class PluginTheiaFileHandler implements PluginDeployerFileHandler {
|
|
|
32
32
|
@inject(PluginTheiaEnvironment)
|
|
33
33
|
protected readonly environment: PluginTheiaEnvironment;
|
|
34
34
|
|
|
35
|
+
@inject(ILogger) @named('plugin-ext:PluginTheiaFileHandler')
|
|
36
|
+
protected readonly logger: ILogger;
|
|
37
|
+
|
|
35
38
|
constructor() {
|
|
36
39
|
this.systemPluginsDirUri = new Deferred();
|
|
37
40
|
getTempDirPathAsync('theia-unpacked')
|
|
@@ -48,14 +51,14 @@ export class PluginTheiaFileHandler implements PluginDeployerFileHandler {
|
|
|
48
51
|
async handle(context: PluginDeployerFileHandlerContext): Promise<void> {
|
|
49
52
|
const id = context.pluginEntry().id();
|
|
50
53
|
const pluginDir = await this.getPluginDir(context);
|
|
51
|
-
|
|
54
|
+
this.logger.info(`[${id}]: trying to decompress into "${pluginDir}"...`);
|
|
52
55
|
if (context.pluginEntry().type === PluginType.User && await fs.pathExists(pluginDir)) {
|
|
53
|
-
|
|
56
|
+
this.logger.info(`[${id}]: already found`);
|
|
54
57
|
context.pluginEntry().updatePath(pluginDir);
|
|
55
58
|
return;
|
|
56
59
|
}
|
|
57
60
|
await context.unzip(context.pluginEntry().path(), pluginDir);
|
|
58
|
-
|
|
61
|
+
this.logger.info(`[${id}]: decompressed`);
|
|
59
62
|
context.pluginEntry().updatePath(pluginDir);
|
|
60
63
|
}
|
|
61
64
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
17
|
+
import { injectable, inject, named } from '@theia/core/shared/inversify';
|
|
18
18
|
import URI from '@theia/core/lib/common/uri';
|
|
19
19
|
import * as path from 'path';
|
|
20
20
|
import * as fs from '@theia/core/shared/fs-extra';
|
|
@@ -35,7 +35,7 @@ const SESSION_TIMESTAMP_PATTERN = /^\d{8}T\d{6}$/;
|
|
|
35
35
|
@injectable()
|
|
36
36
|
export class PluginPathsServiceImpl implements PluginPathsService {
|
|
37
37
|
|
|
38
|
-
@inject(ILogger)
|
|
38
|
+
@inject(ILogger) @named('plugin-ext:PluginPathsServiceImpl')
|
|
39
39
|
protected readonly logger: ILogger;
|
|
40
40
|
|
|
41
41
|
@inject(EnvVariablesServer)
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import { BackendApplicationContribution } from '@theia/core/lib/node';
|
|
18
|
-
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
18
|
+
import { injectable, inject, named } from '@theia/core/shared/inversify';
|
|
19
19
|
import { PluginDeployer } from '../../common/plugin-protocol';
|
|
20
20
|
import { ILogger } from '@theia/core';
|
|
21
21
|
|
|
22
22
|
@injectable()
|
|
23
23
|
export class PluginDeployerContribution implements BackendApplicationContribution {
|
|
24
24
|
|
|
25
|
-
@inject(ILogger)
|
|
25
|
+
@inject(ILogger) @named('plugin-ext:PluginDeployerContribution')
|
|
26
26
|
protected readonly logger: ILogger;
|
|
27
27
|
|
|
28
28
|
@inject(PluginDeployer)
|