mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-11 19:29:28 +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,11 +1,14 @@
|
||||
import type { Disposable } from '@theia/core/lib/common/disposable';
|
||||
import type { AppInfo } from '../electron-common/electron-arduino';
|
||||
import type { StartupTasks } from '../electron-common/startup-task';
|
||||
import type { Sketch } from './contributions/contribution';
|
||||
|
||||
export type { AppInfo };
|
||||
|
||||
export const AppService = Symbol('AppService');
|
||||
export interface AppService {
|
||||
quit(): void;
|
||||
version(): Promise<string>;
|
||||
info(): Promise<AppInfo>;
|
||||
registerStartupTasksHandler(
|
||||
handler: (tasks: StartupTasks) => void
|
||||
): Disposable;
|
||||
|
||||
@@ -30,7 +30,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 { EditorCommands } from '@theia/editor/lib/browser/editor-command';
|
||||
import { EditorMainMenu } from '@theia/editor/lib/browser/editor-menu';
|
||||
import { MonacoMenus } from '@theia/monaco/lib/browser/monaco-menu';
|
||||
@@ -69,7 +69,7 @@ export class ArduinoFrontendContribution
|
||||
private readonly appStateService: FrontendApplicationStateService;
|
||||
|
||||
@postConstruct()
|
||||
protected async init(): Promise<void> {
|
||||
protected init(): void {
|
||||
if (!window.navigator.onLine) {
|
||||
// tslint:disable-next-line:max-line-length
|
||||
this.messageService.warn(
|
||||
|
||||
@@ -355,10 +355,8 @@ import { StylingParticipant } from '@theia/core/lib/browser/styling-service';
|
||||
import { MonacoEditorMenuContribution } from './theia/monaco/monaco-menu';
|
||||
import { MonacoEditorMenuContribution as TheiaMonacoEditorMenuContribution } from '@theia/monaco/lib/browser/monaco-menu';
|
||||
import { UpdateArduinoState } from './contributions/update-arduino-state';
|
||||
import { TerminalWidgetImpl } from './theia/terminal/terminal-widget-impl';
|
||||
import { TerminalWidget } from '@theia/terminal/lib/browser/base/terminal-widget';
|
||||
import { TerminalFrontendContribution } from './theia/terminal/terminal-frontend-contribution';
|
||||
import { TerminalFrontendContribution as TheiaTerminalFrontendContribution } from '@theia/terminal/lib/browser/terminal-frontend-contribution'
|
||||
import { TerminalFrontendContribution as TheiaTerminalFrontendContribution } from '@theia/terminal/lib/browser/terminal-frontend-contribution';
|
||||
|
||||
// Hack to fix copy/cut/paste issue after electron version update in Theia.
|
||||
// https://github.com/eclipse-theia/theia/issues/12487
|
||||
@@ -1032,7 +1030,8 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
||||
);
|
||||
|
||||
// Patch terminal issues.
|
||||
rebind(TerminalWidget).to(TerminalWidgetImpl).inTransientScope();
|
||||
bind(TerminalFrontendContribution).toSelf().inSingletonScope();
|
||||
rebind(TheiaTerminalFrontendContribution).toService(TerminalFrontendContribution);
|
||||
rebind(TheiaTerminalFrontendContribution).toService(
|
||||
TerminalFrontendContribution
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import { injectable, inject } from '@theia/core/shared/inversify';
|
||||
import { Emitter } from '@theia/core/lib/common/event';
|
||||
import { ReactWidget, Message } 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 { Event } from '@theia/core/lib/common/event';
|
||||
import { notEmpty } from '@theia/core/lib/common/objects';
|
||||
import { MaybePromise } from '@theia/core/lib/common/types';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import * as ReactDOM from '@theia/core/shared/react-dom';
|
||||
import { CommandRegistry } from '@theia/core/lib/common/command';
|
||||
import { DisposableCollection } from '@theia/core/lib/common/disposable';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
|
||||
export type ProgressBarProps = {
|
||||
percent?: number;
|
||||
|
||||
@@ -4,7 +4,6 @@ import { nls } from '@theia/core/lib/common/nls';
|
||||
import { isOSX, isWindows } from '@theia/core/lib/common/os';
|
||||
import { inject, injectable } from '@theia/core/shared/inversify';
|
||||
import moment from 'moment';
|
||||
import { ConfigService } from '../../common/protocol';
|
||||
import { AppService } from '../app-service';
|
||||
import { ArduinoMenus } from '../menu/arduino-menus';
|
||||
import {
|
||||
@@ -18,8 +17,6 @@ import {
|
||||
export class About extends Contribution {
|
||||
@inject(ClipboardService)
|
||||
private readonly clipboardService: ClipboardService;
|
||||
@inject(ConfigService)
|
||||
private readonly configService: ConfigService;
|
||||
@inject(AppService)
|
||||
private readonly appService: AppService;
|
||||
|
||||
@@ -42,11 +39,9 @@ export class About extends Contribution {
|
||||
}
|
||||
|
||||
private async showAbout(): Promise<void> {
|
||||
const [appVersion, cliVersion] = await Promise.all([
|
||||
this.appService.version(),
|
||||
this.configService.getVersion(),
|
||||
]);
|
||||
const buildDate = this.buildDate;
|
||||
const appInfo = await this.appService.info();
|
||||
const { appVersion, cliVersion, buildDate } = appInfo;
|
||||
|
||||
const detail = (showAll: boolean) =>
|
||||
nls.localize(
|
||||
'arduino/about/detail',
|
||||
@@ -84,10 +79,6 @@ export class About extends Contribution {
|
||||
return FrontendApplicationConfigProvider.get().applicationName;
|
||||
}
|
||||
|
||||
private get buildDate(): string | undefined {
|
||||
return FrontendApplicationConfigProvider.get().buildDate;
|
||||
}
|
||||
|
||||
private ago(isoTime: string): string {
|
||||
const now = moment(Date.now());
|
||||
const other = moment(isoTime);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { nls } from '@theia/core/lib/common';
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
|
||||
export const CertificateAddComponent = ({
|
||||
addCertificate,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
|
||||
export const CertificateListComponent = ({
|
||||
certificates,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import Tippy from '@tippyjs/react';
|
||||
import { AvailableBoard } from '../../boards/boards-service-provider';
|
||||
import { CertificateListComponent } from './certificate-list';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import {
|
||||
inject,
|
||||
injectable,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { nls } from '@theia/core/lib/common';
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import { AvailableBoard } from '../../boards/boards-service-provider';
|
||||
import { ArduinoSelect } from '../../widgets/arduino-select';
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { nls } from '@theia/core/lib/common/nls';
|
||||
import { MaybePromise } from '@theia/core/lib/common/types';
|
||||
import { Message } from '@theia/core/shared/@phosphor/messaging';
|
||||
import { Widget } from '@theia/core/shared/@phosphor/widgets';
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import { CreateApi } from '../create/create-api';
|
||||
import { AbstractDialog } from '../theia/dialogs/dialogs';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { nls } from '@theia/core/lib/common';
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import { Port } from '../../../common/protocol';
|
||||
import {
|
||||
ArduinoFirmwareUploader,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import {
|
||||
inject,
|
||||
injectable,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { nls } from '@theia/core/lib/common/nls';
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
// @ts-expect-error see https://github.com/microsoft/TypeScript/issues/49721#issuecomment-1319854183
|
||||
import type { Options } from 'react-markdown';
|
||||
import { ProgressInfo, UpdateInfo } from '../../../common/protocol/ide-updater';
|
||||
@@ -111,7 +111,6 @@ export const IDEUpdaterComponent = ({
|
||||
>
|
||||
<ReactMarkdown
|
||||
components={{
|
||||
// @ts-expect-error see imports. There is no ESM type-only import in CommonJS modules.
|
||||
a: ({ href, children, ...props }) => (
|
||||
<a onClick={() => href && openExternal(href)} {...props}>
|
||||
{children}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import {
|
||||
inject,
|
||||
injectable,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs';
|
||||
import 'react-tabs/style/react-tabs.css';
|
||||
import { Disable } from 'react-disable';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import {
|
||||
injectable,
|
||||
inject,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import classnames from 'classnames';
|
||||
|
||||
interface SettingsStepInputProps {
|
||||
|
||||
@@ -117,7 +117,7 @@ export class SettingsService {
|
||||
protected _settings: Settings;
|
||||
|
||||
@postConstruct()
|
||||
protected async init(): Promise<void> {
|
||||
protected init(): void {
|
||||
this.appStateService.reachedState('ready').then(async () => {
|
||||
const settings = await this.loadSettings();
|
||||
this._settings = deepClone(settings);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import { BoardUserField } from '../../../common/protocol';
|
||||
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 { inject, injectable } from '@theia/core/shared/inversify';
|
||||
import { DialogProps } from '@theia/core/lib/browser/dialogs';
|
||||
import { Message } from '@theia/core/shared/@phosphor/messaging';
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
|
||||
import React from '@theia/core/shared/react';
|
||||
import {
|
||||
injectable,
|
||||
inject,
|
||||
postConstruct,
|
||||
} from '@theia/core/shared/inversify';
|
||||
import {
|
||||
AbstractViewContribution,
|
||||
ApplicationShell,
|
||||
codicon
|
||||
codicon,
|
||||
} from '@theia/core/lib/browser';
|
||||
import { MonitorWidget } from './monitor-widget';
|
||||
import { MenuModelRegistry, Command, CommandRegistry } from '@theia/core';
|
||||
@@ -20,7 +24,7 @@ import { MonitorManagerProxyClient } from '../../../common/protocol';
|
||||
import {
|
||||
ArduinoPreferences,
|
||||
defaultMonitorWidgetDockPanel,
|
||||
isMonitorWidgetDockPanel
|
||||
isMonitorWidgetDockPanel,
|
||||
} from '../../arduino-preferences';
|
||||
import { serialMonitorWidgetLabel } from '../../../common/nls';
|
||||
|
||||
@@ -60,7 +64,7 @@ export class MonitorViewContribution
|
||||
static readonly TOGGLE_SERIAL_MONITOR_TOOLBAR =
|
||||
MonitorWidget.ID + ':toggle-toolbar';
|
||||
static readonly RESET_SERIAL_MONITOR = MonitorWidget.ID + ':reset';
|
||||
|
||||
|
||||
@inject(MonitorModel)
|
||||
private readonly model: MonitorModel;
|
||||
@inject(MonitorManagerProxyClient)
|
||||
@@ -85,10 +89,16 @@ export class MonitorViewContribution
|
||||
|
||||
@postConstruct()
|
||||
protected init(): void {
|
||||
this._panel = this.arduinoPreferences['arduino.monitor.dockPanel'] ?? defaultMonitorWidgetDockPanel;
|
||||
this._panel =
|
||||
this.arduinoPreferences['arduino.monitor.dockPanel'] ??
|
||||
defaultMonitorWidgetDockPanel;
|
||||
this.monitorManagerProxy.onMonitorShouldReset(() => this.reset());
|
||||
this.arduinoPreferences.onPreferenceChanged((event) => {
|
||||
if (event.preferenceName === 'arduino.monitor.dockPanel' && isMonitorWidgetDockPanel(event.newValue) && event.newValue !== this._panel) {
|
||||
if (
|
||||
event.preferenceName === 'arduino.monitor.dockPanel' &&
|
||||
isMonitorWidgetDockPanel(event.newValue) &&
|
||||
event.newValue !== this._panel
|
||||
) {
|
||||
this._panel = event.newValue;
|
||||
const widget = this.tryGetWidget();
|
||||
// reopen at the new position if opened
|
||||
@@ -97,14 +107,14 @@ export class MonitorViewContribution
|
||||
this.openView({ activate: true, reveal: true });
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
override get defaultViewOptions(): ApplicationShell.WidgetOptions {
|
||||
const viewOptions = super.defaultViewOptions;
|
||||
return {
|
||||
...viewOptions,
|
||||
area: this._panel
|
||||
area: this._panel,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import {
|
||||
injectable,
|
||||
inject,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import { Key, KeyCode } from '@theia/core/lib/browser/keys';
|
||||
import { Board } from '../../../common/protocol/boards-service';
|
||||
import { DisposableCollection, 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 { Event } from '@theia/core/lib/common/event';
|
||||
import { DisposableCollection } from '@theia/core/lib/common/disposable';
|
||||
import { areEqual, FixedSizeList as List } from 'react-window';
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import {
|
||||
TabBarToolbar,
|
||||
TabBarToolbarRegistry,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import type { Props, StylesConfig, ThemeConfig } from 'react-select';
|
||||
import Select from 'react-select';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import type { Root } from '@theia/core/shared/react-dom/client';
|
||||
import {
|
||||
inject,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import { inject, injectable } from '@theia/core/shared/inversify';
|
||||
import { TreeModel } from '@theia/core/lib/browser/tree/tree-model';
|
||||
import { CloudSketchbookTreeModel } from './cloud-sketchbook-tree-model';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import { DisposableCollection } from '@theia/core/lib/common/disposable';
|
||||
import { CloudSketchbookTreeModel } from './cloud-sketchbook-tree-model';
|
||||
import { AuthenticationClientService } from '../../auth/authentication-client-service';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import type { ArduinoComponent } from '../../../common/protocol/arduino-component';
|
||||
import { Installable } from '../../../common/protocol/installable';
|
||||
import type { ListItemRenderer } from './list-item-renderer';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import { Virtuoso } from '@theia/core/shared/react-virtuoso';
|
||||
import { ArduinoComponent } from '../../../common/protocol/arduino-component';
|
||||
import { Installable } from '../../../common/protocol/installable';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { injectable } from '@theia/core/shared/inversify';
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import {
|
||||
BoardSearch,
|
||||
LibrarySearch,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import debounce from 'lodash.debounce';
|
||||
import { Event } from '@theia/core/lib/common/event';
|
||||
import { CommandService } from '@theia/core/lib/common/command';
|
||||
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
import { MessageService } from '@theia/core/lib/common/message-service';
|
||||
import { nls } from '@theia/core/lib/common/nls';
|
||||
import { inject, injectable } from '@theia/core/shared/inversify';
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import { Unknown } from '../../../common/nls';
|
||||
import {
|
||||
CoreService,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import {
|
||||
injectable,
|
||||
postConstruct,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { nls } from '@theia/core/lib/common';
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
|
||||
export class SearchBar extends React.Component<SearchBar.Props> {
|
||||
constructor(props: Readonly<SearchBar.Props>) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
|
||||
export class CreateNew extends React.Component<CreateNew.Props> {
|
||||
override render(): React.ReactNode {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import { createRoot, Root } from '@theia/core/shared/react-dom/client';
|
||||
import { inject, injectable } from '@theia/core/shared/inversify';
|
||||
import { nls } from '@theia/core/lib/common/nls';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as React from '@theia/core/shared/react';
|
||||
import React from '@theia/core/shared/react';
|
||||
import {
|
||||
inject,
|
||||
injectable,
|
||||
@@ -62,12 +62,16 @@ export class SketchbookTreeWidget extends FileTreeWidget {
|
||||
}
|
||||
|
||||
@postConstruct()
|
||||
protected override async init(): Promise<void> {
|
||||
protected override init(): void {
|
||||
super.init();
|
||||
// cache the current open sketch uri
|
||||
const currentSketch = await this.sketchServiceClient.currentSketch();
|
||||
this.currentSketchUri =
|
||||
(CurrentSketch.isValid(currentSketch) && currentSketch.uri) || '';
|
||||
this.sketchServiceClient
|
||||
.currentSketch()
|
||||
.then(
|
||||
(currentSketch) =>
|
||||
(this.currentSketchUri =
|
||||
(CurrentSketch.isValid(currentSketch) && currentSketch.uri) || '')
|
||||
);
|
||||
}
|
||||
|
||||
protected override createNodeClassNames(
|
||||
|
||||
Reference in New Issue
Block a user