Skip to content

Commit b86675f

Browse files
authored
Merge c75d2b6 into 62736fa
2 parents 62736fa + c75d2b6 commit b86675f

File tree

10 files changed

+1422
-1336
lines changed

10 files changed

+1422
-1336
lines changed

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

+20-20
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,27 @@
2424
},
2525
"dependencies": {
2626
"@grpc/grpc-js": "^1.8.14",
27-
"@theia/application-package": "1.39.0",
28-
"@theia/core": "1.39.0",
29-
"@theia/debug": "1.39.0",
30-
"@theia/editor": "1.39.0",
31-
"@theia/electron": "1.39.0",
32-
"@theia/filesystem": "1.39.0",
33-
"@theia/keymaps": "1.39.0",
34-
"@theia/markers": "1.39.0",
35-
"@theia/messages": "1.39.0",
36-
"@theia/monaco": "1.39.0",
27+
"@theia/application-package": "1.41.0",
28+
"@theia/core": "1.41.0",
29+
"@theia/debug": "1.41.0",
30+
"@theia/editor": "1.41.0",
31+
"@theia/electron": "1.41.0",
32+
"@theia/filesystem": "1.41.0",
33+
"@theia/keymaps": "1.41.0",
34+
"@theia/markers": "1.41.0",
35+
"@theia/messages": "1.41.0",
36+
"@theia/monaco": "1.41.0",
3737
"@theia/monaco-editor-core": "1.72.3",
38-
"@theia/navigator": "1.39.0",
39-
"@theia/outline-view": "1.39.0",
40-
"@theia/output": "1.39.0",
41-
"@theia/plugin-ext": "1.39.0",
42-
"@theia/preferences": "1.39.0",
43-
"@theia/scm": "1.39.0",
44-
"@theia/search-in-workspace": "1.39.0",
45-
"@theia/terminal": "1.39.0",
46-
"@theia/typehierarchy": "1.39.0",
47-
"@theia/workspace": "1.39.0",
38+
"@theia/navigator": "1.41.0",
39+
"@theia/outline-view": "1.41.0",
40+
"@theia/output": "1.41.0",
41+
"@theia/plugin-ext": "1.41.0",
42+
"@theia/preferences": "1.41.0",
43+
"@theia/scm": "1.41.0",
44+
"@theia/search-in-workspace": "1.41.0",
45+
"@theia/terminal": "1.41.0",
46+
"@theia/typehierarchy": "1.41.0",
47+
"@theia/workspace": "1.41.0",
4848
"@tippyjs/react": "^4.2.5",
4949
"@types/auth0-js": "^9.14.0",
5050
"@types/btoa": "^1.2.3",

Diff for: arduino-ide-extension/src/browser/theia/core/common-frontend-contribution.ts

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { injectable } from '@theia/core/shared/inversify';
2-
import { MenuModelRegistry } from '@theia/core/lib/common/menu';
31
import {
4-
CommonFrontendContribution as TheiaCommonFrontendContribution,
52
CommonCommands,
3+
CommonFrontendContribution as TheiaCommonFrontendContribution,
64
} from '@theia/core/lib/browser/common-frontend-contribution';
7-
import { CommandRegistry } from '@theia/core/lib/common/command';
85
import type { OnWillStopAction } from '@theia/core/lib/browser/frontend-application';
9-
import { KeybindingRegistry } from '@theia/core/lib/browser';
10-
import { isOSX } from '@theia/core';
6+
import type { KeybindingRegistry } from '@theia/core/lib/browser/keybinding';
7+
import type { CommandRegistry } from '@theia/core/lib/common/command';
8+
import type { MenuModelRegistry } from '@theia/core/lib/common/menu';
9+
import { isOSX } from '@theia/core/lib/common/os';
10+
import { injectable } from '@theia/core/shared/inversify';
1111

1212
@injectable()
1313
export class CommonFrontendContribution extends TheiaCommonFrontendContribution {
@@ -25,6 +25,7 @@ export class CommonFrontendContribution extends TheiaCommonFrontendContribution
2525
CommonCommands.PIN_TAB,
2626
CommonCommands.UNPIN_TAB,
2727
CommonCommands.NEW_UNTITLED_FILE,
28+
CommonCommands.NEW_UNTITLED_TEXT_FILE,
2829
]) {
2930
commandRegistry.unregisterCommand(command);
3031
}
@@ -48,6 +49,7 @@ export class CommonFrontendContribution extends TheiaCommonFrontendContribution
4849
CommonCommands.ABOUT_COMMAND,
4950
CommonCommands.SAVE_WITHOUT_FORMATTING, // Patched for https://github.com/eclipse-theia/theia/pull/8877,
5051
CommonCommands.NEW_UNTITLED_FILE,
52+
CommonCommands.NEW_UNTITLED_TEXT_FILE,
5153
]) {
5254
registry.unregisterMenuAction(command);
5355
}

Diff for: arduino-ide-extension/src/node/auth/authentication-server.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function createServer(
2929
}
3030

3131
export async function startServer(server: http.Server): Promise<string> {
32-
let portTimer: NodeJS.Timer;
32+
let portTimer: NodeJS.Timeout;
3333

3434
function cancelPortTimer() {
3535
clearTimeout(portTimer);

Diff for: arduino-ide-extension/src/node/theia/plugin-ext/plugin-reader.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ import { HostedPluginReader as TheiaHostedPluginReader } from '@theia/plugin-ext
77

88
@injectable()
99
export class HostedPluginReader extends TheiaHostedPluginReader {
10-
override readContribution(
10+
override async readContribution(
1111
plugin: PluginPackage
12-
): PluginContribution | undefined {
12+
): Promise<PluginContribution | undefined> {
1313
const scanner = this.scanner.getScanner(plugin);
14-
const contributions = scanner.getContribution(plugin);
14+
const contributions = await scanner.getContribution(plugin);
1515
return this.filterContribution(plugin.name, contributions);
1616
}
17+
1718
private filterContribution(
1819
pluginName: string,
1920
contributions: PluginContribution | undefined

Diff for: arduino-ide-extension/src/node/theia/workspace/default-workspace-server.ts

+2-32
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { promises as fs, constants } from 'node:fs';
2-
import { injectable, inject } from '@theia/core/shared/inversify';
1+
import { FileUri } from '@theia/core/lib/node';
2+
import { inject, injectable } from '@theia/core/shared/inversify';
33
import { DefaultWorkspaceServer as TheiaDefaultWorkspaceServer } from '@theia/workspace/lib/node/default-workspace-server';
44
import { SketchesService } from '../../../common/protocol';
5-
import { FileUri } from '@theia/core/lib/node';
65
import { IsTempSketch } from '../../is-temp-sketch';
76

87
@injectable()
@@ -21,26 +20,6 @@ export class DefaultWorkspaceServer extends TheiaDefaultWorkspaceServer {
2120
return uri;
2221
}
2322

24-
/**
25-
* This is the async re-implementation of the default Theia behavior.
26-
*/
27-
override async getRecentWorkspaces(): Promise<string[]> {
28-
const listUri: string[] = [];
29-
const data = await this.readRecentWorkspacePathsFromUserHome();
30-
if (data && data.recentRoots) {
31-
await Promise.all(
32-
data.recentRoots
33-
.filter((element) => Boolean(element))
34-
.map(async (element) => {
35-
if (await this.exists(element)) {
36-
listUri.push(element);
37-
}
38-
})
39-
);
40-
}
41-
return listUri;
42-
}
43-
4423
protected override async writeToUserHome(
4524
data: RecentWorkspacePathsData
4625
): Promise<void> {
@@ -69,15 +48,6 @@ export class DefaultWorkspaceServer extends TheiaDefaultWorkspaceServer {
6948
recentRoots,
7049
};
7150
}
72-
73-
private async exists(uri: string): Promise<boolean> {
74-
try {
75-
await fs.access(FileUri.fsPath(uri), constants.R_OK | constants.W_OK);
76-
return true;
77-
} catch {
78-
return false;
79-
}
80-
}
8151
}
8252

8353
// Remove after https://github.com/eclipse-theia/theia/pull/11603

Diff for: electron-app/package.json

+28-28
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55
"license": "AGPL-3.0-or-later",
66
"main": "./src-gen/backend/electron-main.js",
77
"dependencies": {
8-
"@theia/core": "1.39.0",
9-
"@theia/debug": "1.39.0",
10-
"@theia/editor": "1.39.0",
11-
"@theia/electron": "1.39.0",
12-
"@theia/filesystem": "1.39.0",
13-
"@theia/keymaps": "1.39.0",
14-
"@theia/messages": "1.39.0",
15-
"@theia/monaco": "1.39.0",
16-
"@theia/navigator": "1.39.0",
17-
"@theia/plugin-ext": "1.39.0",
18-
"@theia/plugin-ext-vscode": "1.39.0",
19-
"@theia/preferences": "1.39.0",
20-
"@theia/terminal": "1.39.0",
21-
"@theia/workspace": "1.39.0",
8+
"@theia/core": "1.41.0",
9+
"@theia/debug": "1.41.0",
10+
"@theia/editor": "1.41.0",
11+
"@theia/electron": "1.41.0",
12+
"@theia/filesystem": "1.41.0",
13+
"@theia/keymaps": "1.41.0",
14+
"@theia/messages": "1.41.0",
15+
"@theia/monaco": "1.41.0",
16+
"@theia/navigator": "1.41.0",
17+
"@theia/plugin-ext": "1.41.0",
18+
"@theia/plugin-ext-vscode": "1.41.0",
19+
"@theia/preferences": "1.41.0",
20+
"@theia/terminal": "1.41.0",
21+
"@theia/workspace": "1.41.0",
2222
"arduino-ide-extension": "2.2.2"
2323
},
2424
"devDependencies": {
25-
"@theia/cli": "1.39.0",
25+
"@theia/cli": "1.41.0",
2626
"7zip-min": "^1.4.4",
2727
"chmodr": "^1.2.0",
2828
"compression-webpack-plugin": "^9.0.0",
@@ -201,22 +201,22 @@
201201
"vscode-builtin-json-language-features": "https://open-vsx.org/api/vscode/json-language-features/1.46.1/file/vscode.json-language-features-1.46.1.vsix",
202202
"cortex-debug": "https://downloads.arduino.cc/marus25.cortex-debug/marus25.cortex-debug-1.5.1.vsix",
203203
"vscode-language-pack-bg": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-bg/1.48.3/file/MS-CEINTL.vscode-language-pack-bg-1.48.3.vsix",
204-
"vscode-language-pack-cs": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-cs/1.78.0/file/MS-CEINTL.vscode-language-pack-cs-1.78.0.vsix",
205-
"vscode-language-pack-de": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-de/1.78.0/file/MS-CEINTL.vscode-language-pack-de-1.78.0.vsix",
206-
"vscode-language-pack-es": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-es/1.78.0/file/MS-CEINTL.vscode-language-pack-es-1.78.0.vsix",
207-
"vscode-language-pack-fr": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-fr/1.78.0/file/MS-CEINTL.vscode-language-pack-fr-1.78.0.vsix",
204+
"vscode-language-pack-cs": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-cs/1.80.0/file/MS-CEINTL.vscode-language-pack-cs-1.80.0.vsix",
205+
"vscode-language-pack-de": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-de/1.80.0/file/MS-CEINTL.vscode-language-pack-de-1.80.0.vsix",
206+
"vscode-language-pack-es": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-es/1.80.0/file/MS-CEINTL.vscode-language-pack-es-1.80.0.vsix",
207+
"vscode-language-pack-fr": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-fr/1.80.0/file/MS-CEINTL.vscode-language-pack-fr-1.80.0.vsix",
208208
"vscode-language-pack-hu": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-hu/1.48.3/file/MS-CEINTL.vscode-language-pack-hu-1.48.3.vsix",
209-
"vscode-language-pack-it": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-it/1.78.0/file/MS-CEINTL.vscode-language-pack-it-1.78.0.vsix",
210-
"vscode-language-pack-ja": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-ja/1.78.0/file/MS-CEINTL.vscode-language-pack-ja-1.78.0.vsix",
211-
"vscode-language-pack-ko": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-ko/1.78.0/file/MS-CEINTL.vscode-language-pack-ko-1.78.0.vsix",
209+
"vscode-language-pack-it": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-it/1.80.0/file/MS-CEINTL.vscode-language-pack-it-1.80.0.vsix",
210+
"vscode-language-pack-ja": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-ja/1.80.0/file/MS-CEINTL.vscode-language-pack-ja-1.80.0.vsix",
211+
"vscode-language-pack-ko": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-ko/1.80.0/file/MS-CEINTL.vscode-language-pack-ko-1.80.0.vsix",
212212
"vscode-language-pack-nl": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-nl/1.48.3/file/MS-CEINTL.vscode-language-pack-nl-1.48.3.vsix",
213-
"vscode-language-pack-pl": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-pl/1.78.0/file/MS-CEINTL.vscode-language-pack-pl-1.78.0.vsix",
214-
"vscode-language-pack-pt-BR": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-pt-BR/1.78.0/file/MS-CEINTL.vscode-language-pack-pt-BR-1.78.0.vsix",
215-
"vscode-language-pack-ru": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-ru/1.78.0/file/MS-CEINTL.vscode-language-pack-ru-1.78.0.vsix",
216-
"vscode-language-pack-tr": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-tr/1.78.0/file/MS-CEINTL.vscode-language-pack-tr-1.78.0.vsix",
213+
"vscode-language-pack-pl": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-pl/1.80.0/file/MS-CEINTL.vscode-language-pack-pl-1.80.0.vsix",
214+
"vscode-language-pack-pt-BR": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-pt-BR/1.80.0/file/MS-CEINTL.vscode-language-pack-pt-BR-1.80.0.vsix",
215+
"vscode-language-pack-ru": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-ru/1.80.0/file/MS-CEINTL.vscode-language-pack-ru-1.80.0.vsix",
216+
"vscode-language-pack-tr": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-tr/1.80.0/file/MS-CEINTL.vscode-language-pack-tr-1.80.0.vsix",
217217
"vscode-language-pack-uk": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-uk/1.48.3/file/MS-CEINTL.vscode-language-pack-uk-1.48.3.vsix",
218-
"vscode-language-pack-zh-hans": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-zh-hans/1.78.0/file/MS-CEINTL.vscode-language-pack-zh-hans-1.78.0.vsix",
219-
"vscode-language-pack-zh-hant": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-zh-hant/1.78.0/file/MS-CEINTL.vscode-language-pack-zh-hant-1.78.0.vsix"
218+
"vscode-language-pack-zh-hans": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-zh-hans/1.80.0/file/MS-CEINTL.vscode-language-pack-zh-hans-1.80.0.vsix",
219+
"vscode-language-pack-zh-hant": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-zh-hant/1.80.0/file/MS-CEINTL.vscode-language-pack-zh-hant-1.80.0.vsix"
220220
},
221221
"mocha": {
222222
"reporter": "spec",

Diff for: electron-app/webpack.base.js

+9-47
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
const chmodr = require('chmodr');
55
const CopyWebpackPlugin = require('copy-webpack-plugin');
66
const path = require('node:path');
7-
const fs = require('node:fs/promises');
8-
9-
const isWindows = process.platform === 'win32';
10-
const isMacOS = process.platform === 'darwin';
117

8+
/**
9+
* @param {string} target the name of the `npm` package to resolve.
10+
*/
1211
function resolvePackagePath(target, baseDir = __dirname) {
1312
const resolvePackageJsonPath = require('resolve-package-path');
1413
const packageJsonPath = resolvePackageJsonPath(target, baseDir);
@@ -23,9 +22,11 @@ function resolvePackagePath(target, baseDir = __dirname) {
2322
// restore file permissions after webpack copy
2423
// https://github.com/webpack-contrib/copy-webpack-plugin/issues/35#issuecomment-1407280257
2524
class PermissionsPlugin {
26-
constructor(targetPath, patchTheia12780 = false) {
25+
/**
26+
* @param {string} targetPath
27+
*/
28+
constructor(targetPath) {
2729
this.targetPath = targetPath;
28-
this.patchTheia12780 = patchTheia12780;
2930
}
3031

3132
/**
@@ -34,20 +35,6 @@ class PermissionsPlugin {
3435
apply(compiler) {
3536
compiler.hooks.afterEmit.tap('PermissionsPlugin', () => {
3637
return new Promise(async (resolve, reject) => {
37-
if (this.patchTheia12780) {
38-
let trashBinaryFilename = undefined;
39-
if (isWindows) {
40-
trashBinaryFilename = 'windows-trash.exe';
41-
} else if (isMacOS) {
42-
trashBinaryFilename = 'macos-trash';
43-
}
44-
if (trashBinaryFilename) {
45-
await fs.chmod(
46-
path.join(__dirname, 'lib', 'backend', trashBinaryFilename),
47-
0o755
48-
);
49-
}
50-
}
5138
chmodr(this.targetPath, 0o755, (err) =>
5239
err ? reject(err) : resolve(undefined)
5340
);
@@ -59,18 +46,9 @@ class PermissionsPlugin {
5946
/**
6047
* Creates webpack plugins to copy all required resources (binaries, plotter app, translation files, etc.) to the appropriate location.
6148
* @param {string} targetPath where to copy the resources
62-
* @param {boolean|undefined} [patchTheia12780=true] to apply patch for https://github.com/eclipse-theia/theia/issues/12780. Only required in the production app.
6349
* @param {string|undefined} [baseDir=__dirname] to calculate the modules from. Defaults to `__dirname`
6450
*/
65-
function createCopyArduinoResourcesPlugins(
66-
targetPath,
67-
patchTheia12780 = false,
68-
baseDir = __dirname
69-
) {
70-
const trashBinariesPath = path.join(
71-
resolvePackagePath('trash', baseDir),
72-
'lib'
73-
);
51+
function createCopyArduinoResourcesPlugins(targetPath, baseDir = __dirname) {
7452
const copyOptions = {
7553
patterns: [
7654
// binaries
@@ -96,25 +74,9 @@ function createCopyArduinoResourcesPlugins(
9674
},
9775
],
9876
};
99-
100-
if (patchTheia12780) {
101-
// workaround for https://github.com/eclipse-theia/theia/issues/12780
102-
// copy the Windows (`windows-trash.exe`) and macOS (`macos-trash`) executables for `trash`
103-
if (isWindows) {
104-
copyOptions.patterns.push({
105-
from: path.join(trashBinariesPath, 'windows-trash.exe'),
106-
to: path.resolve(__dirname, 'lib', 'backend'),
107-
});
108-
} else if (isMacOS) {
109-
copyOptions.patterns.push({
110-
from: path.join(trashBinariesPath, 'macos-trash'),
111-
to: path.resolve(__dirname, 'lib', 'backend'),
112-
});
113-
}
114-
}
11577
return [
11678
new CopyWebpackPlugin(copyOptions),
117-
new PermissionsPlugin(targetPath, patchTheia12780),
79+
new PermissionsPlugin(targetPath),
11880
];
11981
}
12082

Diff for: electron-app/webpack.config.js

+1-10
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,11 @@ mainWindowConfig.plugins?.push(
2121
);
2222
const preloadConfig = frontend[2];
2323

24-
// Taken from https://github.com/eclipse-theia/theia-blueprint/blob/022878d5488c47650fb17b5fdf49a28be88465fe/applications/electron/webpack.config.js#L18-L21
25-
if (process.platform !== 'win32') {
26-
// For some reason, blueprint wants to bundle the `.node` files directly without going through `@vscode/windows-ca-certs`
27-
backend.ignoredResources.add(
28-
'@vscode/windows-ca-certs/build/Release/crypt32.node'
29-
);
30-
}
31-
3224
// Copy all the IDE2 binaries and the plotter web app.
3325
// XXX: For whatever reason it is important to use `unshift` instead of `push`, and execute the additional webpack plugins before the Theia contributed ones kick in. Otherwise ours do not work.
3426
backend.config.plugins.unshift(
3527
...createCopyArduinoResourcesPlugins(
36-
path.resolve(__dirname, 'lib', 'backend', 'resources'),
37-
true
28+
path.resolve(__dirname, 'lib', 'backend', 'resources')
3829
)
3930
);
4031

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"node": ">=18.17.0 <21"
1111
},
1212
"devDependencies": {
13-
"@theia/cli": "1.39.0",
13+
"@theia/cli": "1.41.0",
1414
"@typescript-eslint/eslint-plugin": "^5.59.0",
1515
"@typescript-eslint/parser": "^5.59.0",
1616
"@xhmikosr/downloader": "^13.0.1",

0 commit comments

Comments
 (0)