Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSX: Add 'Local' PluginType #9247

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
}
}
});
Expand Down
14 changes: 12 additions & 2 deletions packages/plugin-ext/src/common/plugin-protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions packages/vsx-registry/src/browser/vsx-extension.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<VSXExtensionData>): void {
for (const key of VSXExtensionData.KEYS) {
if (key in data) {
Expand Down