Skip to content

Commit bbeeb08

Browse files
committed
Update Theia to 1.22.1
1 parent ef2be1c commit bbeeb08

27 files changed

+677
-1374
lines changed

Diff for: .vscode/launch.json

+16
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@
3737
"internalConsoleOptions": "openOnSessionStart",
3838
"outputCapture": "std"
3939
},
40+
{
41+
"type": "chrome",
42+
"request": "attach",
43+
"name": "Attach to Electron Frontend",
44+
"port": 9222,
45+
"webRoot": "${workspaceFolder}/electron-app"
46+
},
4047
{
4148
"type": "node",
4249
"request": "launch",
@@ -104,5 +111,14 @@
104111
"program": "${workspaceRoot}/electron/packager/index.js",
105112
"cwd": "${workspaceFolder}/electron/packager"
106113
}
114+
],
115+
"compounds": [
116+
{
117+
"name": "Launch Electron Backend & Frontend",
118+
"configurations": [
119+
"App (Electron)",
120+
"Attach to Electron Frontend"
121+
]
122+
}
107123
]
108124
}

Diff for: BUILDING.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ Once you have all the tools installed, you can build the editor following these
5757

5858
3. Rebuild the electron dependencies
5959
```sh
60-
cd electron-app
61-
yarn theia rebuild:electron
62-
cd ..
60+
yarn rebuild:electron
6361
```
6462

6563
4. Start the application

Diff for: arduino-ide-extension/package.json

+17-16
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,23 @@
2121
},
2222
"dependencies": {
2323
"@grpc/grpc-js": "^1.3.7",
24-
"@theia/application-package": "1.19.0",
25-
"@theia/core": "1.19.0",
26-
"@theia/editor": "1.19.0",
27-
"@theia/editor-preview": "1.19.0",
28-
"@theia/filesystem": "1.19.0",
29-
"@theia/git": "1.19.0",
30-
"@theia/keymaps": "1.19.0",
31-
"@theia/markers": "1.19.0",
32-
"@theia/monaco": "1.19.0",
33-
"@theia/navigator": "1.19.0",
34-
"@theia/outline-view": "1.19.0",
35-
"@theia/output": "1.19.0",
36-
"@theia/preferences": "1.19.0",
37-
"@theia/search-in-workspace": "1.19.0",
38-
"@theia/terminal": "1.19.0",
39-
"@theia/workspace": "1.19.0",
24+
"@theia/application-package": "1.22.1",
25+
"@theia/core": "1.22.1",
26+
"@theia/editor": "1.22.1",
27+
"@theia/editor-preview": "1.22.1",
28+
"@theia/electron": "1.22.1",
29+
"@theia/filesystem": "1.22.1",
30+
"@theia/git": "1.22.1",
31+
"@theia/keymaps": "1.22.1",
32+
"@theia/markers": "1.22.1",
33+
"@theia/monaco": "1.22.1",
34+
"@theia/navigator": "1.22.1",
35+
"@theia/outline-view": "1.22.1",
36+
"@theia/output": "1.22.1",
37+
"@theia/preferences": "1.22.1",
38+
"@theia/search-in-workspace": "1.22.1",
39+
"@theia/terminal": "1.22.1",
40+
"@theia/workspace": "1.22.1",
4041
"@tippyjs/react": "^4.2.5",
4142
"@types/atob": "^2.1.2",
4243
"@types/auth0-js": "^9.14.0",

Diff for: arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { inject, injectable, postConstruct } from 'inversify';
22
import * as React from 'react';
3-
import { remote } from 'electron';
3+
import * as remote from '@theia/core/electron-shared/@electron/remote';
44
import {
55
BoardsService,
66
SketchesService,

Diff for: arduino-ide-extension/src/browser/contributions/about.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { inject, injectable } from 'inversify';
22
import * as moment from 'moment';
3-
import { remote } from 'electron';
3+
import * as remote from '@theia/core/electron-shared/@electron/remote';
44
import { isOSX, isWindows } from '@theia/core/lib/common/os';
55
import { ClipboardService } from '@theia/core/lib/browser/clipboard-service';
66
import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider';

Diff for: arduino-ide-extension/src/browser/contributions/add-file.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { inject, injectable } from 'inversify';
2-
import { remote } from 'electron';
2+
import * as remote from '@theia/core/electron-shared/@electron/remote';
33
import { ArduinoMenus } from '../menu/arduino-menus';
44
import {
55
SketchContribution,

Diff for: arduino-ide-extension/src/browser/contributions/add-zip-library.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { inject, injectable } from 'inversify';
2-
import { remote } from 'electron';
2+
import * as remote from '@theia/core/electron-shared/@electron/remote';
33
import URI from '@theia/core/lib/common/uri';
44
import { ConfirmDialog } from '@theia/core/lib/browser/dialogs';
55
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';

Diff for: arduino-ide-extension/src/browser/contributions/archive-sketch.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { injectable } from 'inversify';
2-
import { remote } from 'electron';
2+
import * as remote from '@theia/core/electron-shared/@electron/remote';
33
import * as dateFormat from 'dateformat';
44
import URI from '@theia/core/lib/common/uri';
55
import { ArduinoMenus } from '../menu/arduino-menus';

Diff for: arduino-ide-extension/src/browser/contributions/board-selection.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { inject, injectable } from 'inversify';
2-
import { remote } from 'electron';
2+
import * as remote from '@theia/core/electron-shared/@electron/remote';
33
import { MenuModelRegistry } from '@theia/core/lib/common/menu';
44
import {
55
DisposableCollection,

Diff for: arduino-ide-extension/src/browser/contributions/close.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { inject, injectable } from 'inversify';
22
import { toArray } from '@phosphor/algorithm';
3-
import { remote } from 'electron';
3+
import * as remote from '@theia/core/electron-shared/@electron/remote';
44
import { MonacoEditor } from '@theia/monaco/lib/browser/monaco-editor';
55
import { EditorManager } from '@theia/editor/lib/browser/editor-manager';
66
import { ApplicationShell } from '@theia/core/lib/browser/shell/application-shell';

Diff for: arduino-ide-extension/src/browser/contributions/open-sketch-external.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { injectable } from 'inversify';
2-
import { remote } from 'electron';
2+
import * as remote from '@theia/core/electron-shared/@electron/remote';
33
import URI from '@theia/core/lib/common/uri';
44
import { ArduinoMenus } from '../menu/arduino-menus';
55
import {

Diff for: arduino-ide-extension/src/browser/contributions/open-sketch.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { inject, injectable } from 'inversify';
2-
import { remote } from 'electron';
2+
import * as remote from '@theia/core/electron-shared/@electron/remote';
33
import { MaybePromise } from '@theia/core/lib/common/types';
44
import { Widget, ContextMenuRenderer } from '@theia/core/lib/browser';
55
import {

Diff for: arduino-ide-extension/src/browser/contributions/quit-app.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { injectable } from 'inversify';
2-
import { remote } from 'electron';
2+
import * as remote from '@theia/core/electron-shared/@electron/remote';
33
import { isOSX } from '@theia/core/lib/common/os';
44
import {
55
Contribution,

Diff for: arduino-ide-extension/src/browser/contributions/save-as-sketch.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { injectable } from 'inversify';
2-
import { remote } from 'electron';
2+
import * as remote from '@theia/core/electron-shared/@electron/remote';
33
import * as dateFormat from 'dateformat';
44
import { ArduinoMenus } from '../menu/arduino-menus';
55
import {

Diff for: arduino-ide-extension/src/browser/serial/plotter/plotter-frontend-contribution.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { SerialModel } from '../serial-model';
1010
import { ArduinoMenus } from '../../menu/arduino-menus';
1111
import { Contribution } from '../../contributions/contribution';
1212
import { Endpoint, FrontendApplication } from '@theia/core/lib/browser';
13-
import { ipcRenderer } from '@theia/core/shared/electron';
13+
import { ipcRenderer } from '@theia/electron/shared/electron';
1414
import { SerialConfig } from '../../../common/protocol';
1515
import { SerialConnectionManager } from '../serial-connection-manager';
1616
import { SerialPlotter } from './protocol';

Diff for: arduino-ide-extension/src/browser/theia/debug/debug-session-manager.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,15 @@ export class DebugSessionManager extends TheiaDebugSessionManager {
6262
}
6363
);
6464
}
65-
// TODO: remove as https://github.com/eclipse-theia/theia/issues/10164 is fixed
66-
async terminateSessions(): Promise<void> {
67-
await super.terminateSessions();
68-
this.destroy(this.currentSession?.id);
65+
async terminateSession(session?: DebugSession): Promise<void> {
66+
if (!session) {
67+
this.updateCurrentSession(this._currentSession);
68+
session = this._currentSession;
69+
}
70+
// The cortex-debug extension does not respond to close requests
71+
// So we simply terminate the debug session immediately
72+
// Alternatively the `super.terminateSession` call will terminate it after 5 seconds without a response
73+
await this.debug.terminateDebugSession(session!.id);
74+
await super.terminateSession(session);
6975
}
7076
}

Diff for: arduino-ide-extension/src/browser/theia/workspace/workspace-delete-handler.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { inject, injectable } from 'inversify';
2-
import { remote } from 'electron';
2+
import * as remote from '@theia/core/electron-shared/@electron/remote';
33
import URI from '@theia/core/lib/common/uri';
44
import { WorkspaceDeleteHandler as TheiaWorkspaceDeleteHandler } from '@theia/workspace/lib/browser/workspace-delete-handler';
55
import { SketchesServiceClientImpl } from '../../../common/protocol/sketches-service-client-impl';

Diff for: arduino-ide-extension/src/browser/theia/workspace/workspace-service.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { ArduinoWorkspaceRootResolver } from '../../arduino-workspace-resolver';
1818
import { BoardsServiceProvider } from '../../boards/boards-service-provider';
1919
import { BoardsConfig } from '../../boards/boards-config';
2020
import { nls } from '@theia/core/lib/common';
21+
import { URI as VSCodeUri } from '@theia/core/shared/vscode-uri';
2122

2223
@injectable()
2324
export class WorkspaceService extends TheiaWorkspaceService {
@@ -67,14 +68,16 @@ export class WorkspaceService extends TheiaWorkspaceService {
6768
this.workspaceUri = (async () => {
6869
try {
6970
const hash = window.location.hash;
70-
const [recentWorkspaces, recentSketches] = await Promise.all([
71+
const [recentWorkspacesPaths, recentSketches] = await Promise.all([
7172
this.server.getRecentWorkspaces(),
7273
this.sketchService
7374
.getSketches({})
7475
.then((container) =>
7576
SketchContainer.toArray(container).map((s) => s.uri)
7677
),
7778
]);
79+
// On Dindows, `getRecentWorkspaces` returns only file paths, not URIs as expected by the `isValid` method.
80+
const recentWorkspaces = recentWorkspacesPaths.map(e => VSCodeUri.file(e).toString());
7881
const toOpen = await new ArduinoWorkspaceRootResolver({
7982
isValid: this.isValid.bind(this),
8083
}).resolve({ hash, recentWorkspaces, recentSketches });

Diff for: arduino-ide-extension/src/browser/widgets/sketchbook/sketchbook-widget-contribution.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { remote } from 'electron';
1+
import * as remote from '@theia/core/electron-shared/@electron/remote';
22
import { inject, injectable } from 'inversify';
33
import { CommandRegistry } from '@theia/core/lib/common/command';
44
import { MenuModelRegistry } from '@theia/core/lib/common/menu';
@@ -80,7 +80,7 @@ export class SketchbookWidgetContribution
8080
}
8181

8282
onStart(): void {
83-
this.shell.currentChanged.connect(() =>
83+
this.shell.onDidChangeCurrentWidget(() =>
8484
this.onCurrentWidgetChangedHandler()
8585
);
8686

Diff for: arduino-ide-extension/src/electron-browser/electron-window-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { inject, injectable, postConstruct } from 'inversify';
2-
import { remote } from 'electron';
2+
import * as remote from '@theia/core/electron-shared/@electron/remote';
33
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
44
import {
55
ConnectionStatus,

Diff for: arduino-ide-extension/src/electron-browser/theia/core/electron-main-menu-factory.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { injectable } from 'inversify';
2-
import { remote } from 'electron';
2+
import * as remote from '@theia/core/electron-shared/@electron/remote';
33
import { isOSX } from '@theia/core/lib/common/os';
44
import { Keybinding } from '@theia/core/lib/common/keybinding';
55
import {
@@ -15,7 +15,6 @@ import {
1515
ArduinoMenus,
1616
PlaceholderMenuNode,
1717
} from '../../../browser/menu/arduino-menus';
18-
import electron = require('@theia/core/shared/electron');
1918

2019
@injectable()
2120
export class ElectronMainMenuFactory extends TheiaElectronMainMenuFactory {
@@ -35,9 +34,9 @@ export class ElectronMainMenuFactory extends TheiaElectronMainMenuFactory {
3534
await this.preferencesService.ready;
3635
const createdMenuBar = this.createElectronMenuBar();
3736
if (isOSX) {
38-
electron.remote.Menu.setApplicationMenu(createdMenuBar);
37+
remote.Menu.setApplicationMenu(createdMenuBar);
3938
} else {
40-
electron.remote.getCurrentWindow().setMenu(createdMenuBar);
39+
remote.getCurrentWindow().setMenu(createdMenuBar);
4140
}
4241
}
4342

@@ -81,7 +80,7 @@ export class ElectronMainMenuFactory extends TheiaElectronMainMenuFactory {
8180
protected createOSXMenu(): Electron.MenuItemConstructorOptions {
8281
const { submenu } = super.createOSXMenu();
8382
const label = 'Arduino IDE';
84-
if (!!submenu && !(submenu instanceof remote.Menu)) {
83+
if (!!submenu && !(submenu instanceof Electron.Menu)) {
8584
const [, , /* about */ /* preferences */ ...rest] = submenu;
8685
const about = this.fillMenuTemplate(
8786
[],

Diff for: arduino-ide-extension/src/electron-main/theia/electron-main-application.ts

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import { inject, injectable } from 'inversify';
2-
import {
3-
app,
4-
BrowserWindow,
5-
BrowserWindowConstructorOptions,
6-
screen,
7-
} from 'electron';
2+
import { app, BrowserWindow, BrowserWindowConstructorOptions, ipcMain, screen } from '@theia/electron/shared/electron';
83
import { fork } from 'child_process';
94
import { AddressInfo } from 'net';
105
import { join } from 'path';
@@ -17,7 +12,7 @@ import {
1712
TheiaBrowserWindowOptions,
1813
} from '@theia/core/lib/electron-main/electron-main-application';
1914
import { SplashServiceImpl } from '../splash/splash-service-impl';
20-
import { ipcMain } from '@theia/core/shared/electron';
15+
import * as electronRemoteMain from '@theia/core/electron-shared/@electron/remote/main';
2116

2217
app.commandLine.appendSwitch('disable-http-cache');
2318

@@ -152,6 +147,7 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
152147
this.attachSaveWindowState(electronWindow);
153148
this.attachGlobalShortcuts(electronWindow);
154149
this.restoreMaximizedState(electronWindow, options);
150+
electronRemoteMain.enable(electronWindow.webContents);
155151
return electronWindow;
156152
}
157153

Diff for: browser-app/package.json

+17-17
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@
44
"version": "2.0.0-rc3",
55
"license": "AGPL-3.0-or-later",
66
"dependencies": {
7-
"@theia/core": "1.19.0",
8-
"@theia/debug": "1.19.0",
9-
"@theia/editor": "1.19.0",
10-
"@theia/editor-preview": "1.19.0",
11-
"@theia/file-search": "1.19.0",
12-
"@theia/filesystem": "1.19.0",
13-
"@theia/keymaps": "1.19.0",
14-
"@theia/messages": "1.19.0",
15-
"@theia/monaco": "1.19.0",
16-
"@theia/navigator": "1.19.0",
17-
"@theia/plugin-ext": "1.19.0",
18-
"@theia/plugin-ext-vscode": "1.19.0",
19-
"@theia/preferences": "1.19.0",
20-
"@theia/process": "1.19.0",
21-
"@theia/terminal": "1.19.0",
22-
"@theia/workspace": "1.19.0",
7+
"@theia/core": "1.22.1",
8+
"@theia/debug": "1.22.1",
9+
"@theia/editor": "1.22.1",
10+
"@theia/editor-preview": "1.22.1",
11+
"@theia/file-search": "1.22.1",
12+
"@theia/filesystem": "1.22.1",
13+
"@theia/keymaps": "1.22.1",
14+
"@theia/messages": "1.22.1",
15+
"@theia/monaco": "1.22.1",
16+
"@theia/navigator": "1.22.1",
17+
"@theia/plugin-ext": "1.22.1",
18+
"@theia/plugin-ext-vscode": "1.22.1",
19+
"@theia/preferences": "1.22.1",
20+
"@theia/process": "1.22.1",
21+
"@theia/terminal": "1.22.1",
22+
"@theia/workspace": "1.22.1",
2323
"arduino-ide-extension": "2.0.0-rc3"
2424
},
2525
"devDependencies": {
26-
"@theia/cli": "1.19.0"
26+
"@theia/cli": "1.22.1"
2727
},
2828
"scripts": {
2929
"prepare": "theia build --mode development",

Diff for: electron-app/package.json

+19-18
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,28 @@
55
"license": "AGPL-3.0-or-later",
66
"main": "src-gen/frontend/electron-main.js",
77
"dependencies": {
8-
"@theia/core": "1.19.0",
9-
"@theia/debug": "1.19.0",
10-
"@theia/editor": "1.19.0",
11-
"@theia/editor-preview": "1.19.0",
12-
"@theia/electron": "1.19.0",
13-
"@theia/file-search": "1.19.0",
14-
"@theia/filesystem": "1.19.0",
15-
"@theia/keymaps": "1.19.0",
16-
"@theia/messages": "1.19.0",
17-
"@theia/monaco": "1.19.0",
18-
"@theia/navigator": "1.19.0",
19-
"@theia/plugin-ext": "1.19.0",
20-
"@theia/plugin-ext-vscode": "1.19.0",
21-
"@theia/preferences": "1.19.0",
22-
"@theia/process": "1.19.0",
23-
"@theia/terminal": "1.19.0",
24-
"@theia/workspace": "1.19.0",
8+
"@theia/core": "1.22.1",
9+
"@theia/debug": "1.22.1",
10+
"@theia/editor": "1.22.1",
11+
"@theia/editor-preview": "1.22.1",
12+
"@theia/electron": "1.22.1",
13+
"@theia/file-search": "1.22.1",
14+
"@theia/filesystem": "1.22.1",
15+
"@theia/keymaps": "1.22.1",
16+
"@theia/messages": "1.22.1",
17+
"@theia/monaco": "1.22.1",
18+
"@theia/navigator": "1.22.1",
19+
"@theia/plugin-ext": "1.22.1",
20+
"@theia/plugin-ext-vscode": "1.22.1",
21+
"@theia/preferences": "1.22.1",
22+
"@theia/process": "1.22.1",
23+
"@theia/terminal": "1.22.1",
24+
"@theia/workspace": "1.22.1",
2525
"arduino-ide-extension": "2.0.0-rc3"
2626
},
2727
"devDependencies": {
28-
"@theia/cli": "1.19.0"
28+
"@theia/cli": "1.22.1",
29+
"electron": "^15.3.5"
2930
},
3031
"scripts": {
3132
"prepare": "theia build --mode development",

0 commit comments

Comments
 (0)