mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-09 18:38:33 +00:00
chore(deps): Updated to Theia 1.39.0 (#2144)
- update Theia to `1.39.0`, - remove the application packager and fix the security vulnerabilities, - bundle the backed application with `webpack`, and - enhance the developer docs. Co-authored-by: Akos Kitta <a.kitta@arduino.cc> Co-authored-by: per1234 <accounts@perglass.com> Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { AboutDialog as TheiaAboutDialog } from '@theia/core/lib/browser/about-dialog';
|
||||
|
||||
export class AboutDialog extends TheiaAboutDialog {
|
||||
protected override async init(): Promise<void> {
|
||||
protected override init(): void {
|
||||
// NOOP
|
||||
// IDE2 has a custom about dialog, so it does not make sense to collect Theia extensions at startup time.
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ export class FrontendConnectionStatusService extends TheiaFrontendConnectionStat
|
||||
private readonly connectionProvider: WebSocketConnectionProvider;
|
||||
|
||||
@postConstruct()
|
||||
protected override async init(): Promise<void> {
|
||||
protected override init(): void {
|
||||
this.schedulePing();
|
||||
const refresh = debounce(() => {
|
||||
this.updateStatus(Boolean(this.daemonPort.port) && this.isOnline.online);
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
injectable,
|
||||
postConstruct,
|
||||
} from '@theia/core/shared/inversify';
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import { accountMenu } from '../../contributions/account';
|
||||
import { CreateFeatures } from '../../create/create-features';
|
||||
import { ApplicationConnectionStatusContribution } from './connection-status-service';
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import debounce from 'p-debounce';
|
||||
import {
|
||||
inject,
|
||||
injectable,
|
||||
postConstruct,
|
||||
} from '@theia/core/shared/inversify';
|
||||
import { inject, injectable } from '@theia/core/shared/inversify';
|
||||
import URI from '@theia/core/lib/common/uri';
|
||||
import { Event, Emitter } from '@theia/core/lib/common/event';
|
||||
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
|
||||
@@ -42,9 +38,7 @@ export class DebugConfigurationManager extends TheiaDebugConfigurationManager {
|
||||
return this.onTempContentDidChangeEmitter.event;
|
||||
}
|
||||
|
||||
@postConstruct()
|
||||
protected override async init(): Promise<void> {
|
||||
super.init();
|
||||
protected override async doInit(): Promise<void> {
|
||||
this.appStateService.reachedState('ready').then(async () => {
|
||||
const tempContent = await this.getTempLaunchJsonContent();
|
||||
if (!tempContent) {
|
||||
@@ -78,6 +72,7 @@ export class DebugConfigurationManager extends TheiaDebugConfigurationManager {
|
||||
});
|
||||
this.updateModels();
|
||||
});
|
||||
return super.doInit();
|
||||
}
|
||||
|
||||
protected override updateModels = debounce(async () => {
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
DisposableCollection,
|
||||
} from '@theia/core/lib/common/disposable';
|
||||
import { inject, injectable } from '@theia/core/shared/inversify';
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import { createRoot } from '@theia/core/shared/react-dom/client';
|
||||
|
||||
@injectable()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import { NotificationComponent } from './notification-component';
|
||||
import { NotificationCenterComponent as TheiaNotificationCenterComponent } from '@theia/messages/lib/browser/notification-center-component';
|
||||
import { nls } from '@theia/core/lib/common';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import { NotificationComponent as TheiaNotificationComponent } from '@theia/messages/lib/browser/notification-component';
|
||||
import { nls } from '@theia/core/lib/common';
|
||||
import { codicon } from '@theia/core/lib/browser';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import { NotificationComponent } from './notification-component';
|
||||
import { NotificationToastsComponent as TheiaNotificationToastsComponent } from '@theia/messages/lib/browser/notification-toasts-component';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import {
|
||||
inject,
|
||||
injectable,
|
||||
|
||||
@@ -14,7 +14,7 @@ export class PreferenceTreeGenerator extends TheiaPreferenceTreeGenerator {
|
||||
@inject(FrontendApplicationStateService)
|
||||
private readonly appStateService: FrontendApplicationStateService;
|
||||
|
||||
protected override async init(): Promise<void> {
|
||||
protected override init(): void {
|
||||
this.appStateService.onStateChanged((state) => {
|
||||
this.state = state;
|
||||
// manually trigger a model (and UI) refresh if it was requested during the startup phase.
|
||||
|
||||
@@ -1,38 +1,16 @@
|
||||
import { TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
||||
import { CommandRegistry } from '@theia/core/lib/common/command';
|
||||
import { Widget } from '@theia/core/shared/@phosphor/widgets';
|
||||
import { injectable } from '@theia/core/shared/inversify';
|
||||
import { TerminalWidget } from '@theia/terminal/lib/browser/base/terminal-widget';
|
||||
import {
|
||||
TerminalCommands,
|
||||
TerminalFrontendContribution as TheiaTerminalFrontendContribution,
|
||||
} from '@theia/terminal/lib/browser/terminal-frontend-contribution';
|
||||
|
||||
// Patch for https://github.com/eclipse-theia/theia/pull/12626
|
||||
@injectable()
|
||||
export class TerminalFrontendContribution extends TheiaTerminalFrontendContribution {
|
||||
override registerCommands(commands: CommandRegistry): void {
|
||||
super.registerCommands(commands);
|
||||
commands.unregisterCommand(TerminalCommands.SPLIT);
|
||||
commands.registerCommand(TerminalCommands.SPLIT, {
|
||||
execute: () => this.splitTerminal(),
|
||||
isEnabled: (w) => this.withWidget(w, () => true),
|
||||
isVisible: (w) => this.withWidget(w, () => true),
|
||||
});
|
||||
}
|
||||
|
||||
override registerToolbarItems(toolbar: TabBarToolbarRegistry): void {
|
||||
super.registerToolbarItems(toolbar);
|
||||
// removes the `split-terminal` command from the tabbar toolbar
|
||||
// https://github.com/dankeboy36/esp-exception-decoder/pull/1#pullrequestreview-1500146673
|
||||
toolbar.unregisterItem(TerminalCommands.SPLIT.id);
|
||||
}
|
||||
|
||||
private withWidget<T>(
|
||||
widget: Widget | undefined,
|
||||
fn: (widget: TerminalWidget) => T
|
||||
): T | false {
|
||||
if (widget instanceof TerminalWidget) {
|
||||
return fn(widget);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
import { injectable } from '@theia/core/shared/inversify';
|
||||
import { TerminalWidgetImpl as TheiaTerminalWidgetImpl } from '@theia/terminal/lib/browser/terminal-widget-impl';
|
||||
import debounce from 'p-debounce';
|
||||
|
||||
// Patch for https://github.com/eclipse-theia/theia/pull/12587
|
||||
@injectable()
|
||||
export class TerminalWidgetImpl extends TheiaTerminalWidgetImpl {
|
||||
private readonly debouncedResizeTerminal = debounce(
|
||||
() => this.doResizeTerminal(),
|
||||
50
|
||||
);
|
||||
|
||||
protected override resizeTerminal(): void {
|
||||
this.debouncedResizeTerminal();
|
||||
}
|
||||
|
||||
private doResizeTerminal(): void {
|
||||
const geo = this.fitAddon.proposeDimensions();
|
||||
const cols = geo.cols;
|
||||
const rows = geo.rows - 1; // subtract one row for margin
|
||||
this.term.resize(cols, rows);
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,11 @@ export class WorkspaceInputDialog extends TheiaWorkspaceInputDialog {
|
||||
protected override readonly labelProvider: LabelProvider
|
||||
) {
|
||||
super(props, labelProvider);
|
||||
if (this.contentNode.contains(this.errorMessageNode)) {
|
||||
// Reverts https://github.com/eclipse-theia/theia/pull/12585/files#diff-068570364d86f936ca72dfc52f8bfa93f14f6d971e2e6fa19216f33cb322244bR533-R534
|
||||
this.contentNode.removeChild(this.errorMessageNode);
|
||||
this.controlPanel.prepend(this.errorMessageNode);
|
||||
}
|
||||
this.node.classList.add('workspace-input-dialog');
|
||||
this.appendCloseButton(Dialog.CANCEL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user