Skip to content

Commit

Permalink
MS comments
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-grant-work committed May 17, 2022
1 parent 92af8ef commit 96b3fa2
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export class PluginVsCodeDirectoryHandler implements PluginDeployerDirectoryHand
}

async handle(context: PluginDeployerDirectoryHandlerContext): Promise<void> {

context.pluginEntry().accept(PluginDeployerEntryType.BACKEND);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-ext/src/common/plugin-protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ export interface PluginMetadata {
host: string;
model: PluginModel;
lifecycle: PluginLifecycle;
outOfSynch: boolean;
outOfSync: boolean;
}

export const MetadataProcessor = Symbol('MetadataProcessor');
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-ext/src/hosted/browser/hosted-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ export class HostedPluginSupport {
}
for (const versionedId of uninstalledPluginIds) {
const plugin = this.getPlugin(PluginIdentifiers.unversionedFromVersioned(versionedId));
if (plugin && PluginIdentifiers.componentsToVersionedId(plugin.metadata.model) === versionedId && !plugin.metadata.outOfSynch) {
if (plugin && PluginIdentifiers.componentsToVersionedId(plugin.metadata.model) === versionedId && !plugin.metadata.outOfSync) {
didChangeInstallationStatus = true;
plugin.metadata.outOfSynch = didChangeInstallationStatus = true;
plugin.metadata.outOfSync = didChangeInstallationStatus = true;
}
}
if (newPluginIds.length) {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-ext/src/hosted/node/metadata-scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class MetadataScanner {
host: PLUGIN_HOST_BACKEND,
model: scanner.getModel(plugin),
lifecycle: scanner.getLifecycle(plugin),
outOfSynch: this.uninstallationManager.isUninstalled(PluginIdentifiers.componentsToVersionedId(plugin)),
outOfSync: this.uninstallationManager.isUninstalled(PluginIdentifiers.componentsToVersionedId(plugin)),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class PluginUninstallationManager {
}

markAsInstalled(pluginId: PluginIdentifiers.VersionedId): boolean {
let index;
let index: number;
let didChange = false;
while ((index = this.uninstalledPlugins.indexOf(pluginId)) !== -1) {
this.uninstalledPlugins.splice(index, 1);
Expand Down
18 changes: 9 additions & 9 deletions packages/vsx-registry/src/browser/vsx-extension.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { ProgressService } from '@theia/core/lib/common/progress-service';
import { Endpoint } from '@theia/core/lib/browser/endpoint';
import { VSXEnvironment } from '../common/vsx-environment';
import { VSXExtensionsSearchModel } from './vsx-extensions-search-model';
import { MenuPath } from '@theia/core/lib/common';
import { MenuPath, nls } from '@theia/core/lib/common';
import { codicon, ContextMenuRenderer, TooltipService } from '@theia/core/lib/browser';
import { VSXExtensionNamespaceAccess, VSXUser } from '@theia/ovsx-client/lib/ovsx-types';
import { WindowService } from '@theia/core/lib/browser/window/window-service';
Expand Down Expand Up @@ -293,7 +293,7 @@ export class VSXExtension implements VSXExtensionData, TreeElement {
async install(): Promise<void> {
this._busy++;
try {
await this.progressService.withProgress(`"Installing '${this.id}' extension...`, 'extensions', () =>
await this.progressService.withProgress(nls.localizeByDefault("Installing extension '{0}' v{1}...", this.id, this.version ?? 0), 'extensions', () =>
this.pluginServer.deploy(this.uri.toString())
);
} finally {
Expand All @@ -307,7 +307,7 @@ export class VSXExtension implements VSXExtensionData, TreeElement {
const { plugin } = this;
if (plugin) {
await this.progressService.withProgress(
`Uninstalling '${this.id}' extension...`, 'extensions',
nls.localizeByDefault('Uninstalling {0}...', this.id), 'extensions',
() => this.pluginServer.uninstall(PluginIdentifiers.componentsToVersionedId(plugin.metadata.model))
);
}
Expand Down Expand Up @@ -406,28 +406,28 @@ export abstract class AbstractVSXExtensionComponent extends React.Component<Abst
const extension = this.props.extension;
const { builtin, busy, plugin } = extension;
const installed = !!plugin;
const outOfSynch = plugin?.metadata.outOfSynch;
const outOfSynch = plugin?.metadata.outOfSync;
if (builtin) {
return <div className="codicon codicon-settings-gear action" onClick={this.manage}></div>;
}
if (busy) {
if (installed) {
return <button className="theia-button action theia-mod-disabled">Uninstalling</button>;
return <button className="theia-button action theia-mod-disabled">{nls.localizeByDefault('Uninstalling')}</button>;
}
return <button className="theia-button action prominent theia-mod-disabled">Installing</button>;
return <button className="theia-button action prominent theia-mod-disabled">{nls.localizeByDefault('Installing')}</button>;
}
if (installed) {
return <div>
{
outOfSynch
? <button className="theia-button action" onClick={this.reloadWindow}>Reload Required</button>
: <button className="theia-button action" onClick={this.uninstall}>Uninstall</button>
? <button className="theia-button action" onClick={this.reloadWindow}>{nls.localizeByDefault('Reload Required')}</button>
: <button className="theia-button action" onClick={this.uninstall}>{nls.localizeByDefault('Uninstall')}</button>
}

<div className="codicon codicon-settings-gear action" onClick={this.manage}></div>
</div>;
}
return <button className="theia-button prominent action" onClick={this.install}>Install</button>;
return <button className="theia-button prominent action" onClick={this.install}>{nls.localizeByDefault('Install')}</button>;
}

}
Expand Down

0 comments on commit 96b3fa2

Please sign in to comment.