diff --git a/packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts b/packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts index 006df2d3bfa4b..716cafd92b997 100755 --- a/packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts +++ b/packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts @@ -53,7 +53,7 @@ import { DiffService } from '@theia/workspace/lib/browser/diff-service'; import { inject, injectable } from 'inversify'; import { Position } from '@theia/plugin-ext/lib/common/plugin-api-rpc'; import { URI } from 'vscode-uri'; -import { PluginServer } from '@theia/plugin-ext/lib/common/plugin-protocol'; +import { PluginServer, PluginType } from '@theia/plugin-ext/lib/common/plugin-protocol'; import { MonacoEditor } from '@theia/monaco/lib/browser/monaco-editor'; import { TerminalFrontendContribution } from '@theia/terminal/lib/browser/terminal-frontend-contribution'; import { QuickOpenWorkspace } from '@theia/workspace/lib/browser/quick-open-workspace'; @@ -232,7 +232,7 @@ export class PluginVscodeCommandsContribution implements CommandContribution { await this.pluginServer.deploy(`vscode:extension/${vsixUriOrExtensionId}`); } else { const uriPath = isUriComponents(vsixUriOrExtensionId) ? URI.revive(vsixUriOrExtensionId).fsPath : await this.fileService.fsPath(vsixUriOrExtensionId); - await this.pluginServer.deploy(`local-file:${uriPath}`); + await this.pluginServer.deploy(`local-file:${uriPath}`, PluginType.Local); } } }); diff --git a/packages/plugin-ext/src/common/plugin-protocol.ts b/packages/plugin-ext/src/common/plugin-protocol.ts index 2c1b7f7f179bb..9d80785ed378f 100644 --- a/packages/plugin-ext/src/common/plugin-protocol.ts +++ b/packages/plugin-ext/src/common/plugin-protocol.ts @@ -382,11 +382,21 @@ export enum PluginDeployerEntryType { } /** - * Whether a plugin installed by a user or system. + * Represents the different plugin installation types. */ export enum PluginType { + /** + * Plugin installed by the system. + */ System, - User + /** + * Plugin installed by the user. + */ + User, + /** + * Plugin installed locally (upload). + */ + Local }; export interface PluginDeployerEntry { diff --git a/packages/vsx-registry/src/browser/vsx-extension.tsx b/packages/vsx-registry/src/browser/vsx-extension.tsx index 62a53bebc4060..3225351522455 100644 --- a/packages/vsx-registry/src/browser/vsx-extension.tsx +++ b/packages/vsx-registry/src/browser/vsx-extension.tsx @@ -126,6 +126,12 @@ export class VSXExtension implements VSXExtensionData, TreeElement { return type === PluginType.System; } + get local(): boolean { + const plugin = this.plugin; + const type = plugin && plugin.type; + return type === PluginType.Local; + } + update(data: Partial): void { for (const key of VSXExtensionData.KEYS) { if (key in data) {