Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8f4bcc8

Browse files
chore(deps): update to theia@1.41.0 (#2211)
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
1 parent ce02e26 commit 8f4bcc8

File tree

12 files changed

+1438
-1338
lines changed

12 files changed

+1438
-1338
lines changed

‎arduino-ide-extension/package.json‎

Lines changed: 20 additions & 20 deletions
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",

‎arduino-ide-extension/src/browser/arduino-ide-frontend-module.ts‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ import { MonacoEditorMenuContribution as TheiaMonacoEditorMenuContribution } fro
358358
import { UpdateArduinoState } from './contributions/update-arduino-state';
359359
import { TerminalFrontendContribution } from './theia/terminal/terminal-frontend-contribution';
360360
import { TerminalFrontendContribution as TheiaTerminalFrontendContribution } from '@theia/terminal/lib/browser/terminal-frontend-contribution';
361+
import { SelectionService } from '@theia/core/lib/common/selection-service';
362+
import { CommandService } from '@theia/core/lib/common/command';
363+
import { CorePreferences } from '@theia/core/lib/browser/core-preferences';
361364

362365
// Hack to fix copy/cut/paste issue after electron version update in Theia.
363366
// https://github.com/eclipse-theia/theia/issues/12487
@@ -796,10 +799,19 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
796799
);
797800
const iconThemeService =
798801
context.container.get<IconThemeService>(IconThemeService);
802+
const selectionService =
803+
context.container.get<SelectionService>(SelectionService);
804+
const commandService =
805+
context.container.get<CommandService>(CommandService);
806+
const corePreferences =
807+
context.container.get<CorePreferences>(CorePreferences);
799808
return new TabBarRenderer(
800809
contextMenuRenderer,
801810
decoratorService,
802-
iconThemeService
811+
iconThemeService,
812+
selectionService,
813+
commandService,
814+
corePreferences
803815
);
804816
});
805817

‎arduino-ide-extension/src/browser/theia/core/common-frontend-contribution.ts‎

Lines changed: 8 additions & 6 deletions
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
}

‎arduino-ide-extension/src/browser/theia/monaco/monaco-text-model-service.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ export class MonacoTextModelService extends TheiaMonacoTextModelService {
1919
const factory = this.factories
2020
.getContributions()
2121
.find(({ scheme }) => resource.uri.scheme === scheme);
22-
const readOnly = this.sketchesServiceClient.isReadOnly(resource.uri);
22+
const readOnly =
23+
Boolean(resource.isReadonly) ||
24+
this.sketchesServiceClient.isReadOnly(resource.uri);
2325
return factory
2426
? factory.createModel(resource)
2527
: new MaybeReadonlyMonacoEditorModel(

‎arduino-ide-extension/src/node/auth/authentication-server.ts‎

Lines changed: 1 addition & 1 deletion
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);

‎arduino-ide-extension/src/node/theia/plugin-ext/plugin-reader.ts‎

Lines changed: 4 additions & 3 deletions
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 asyncreadContribution(
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 = awaitscanner.getContribution(plugin);
1515
return this.filterContribution(plugin.name, contributions);
1616
}
17+
1718
private filterContribution(
1819
pluginName: string,
1920
contributions: PluginContribution | undefined

‎arduino-ide-extension/src/node/theia/workspace/default-workspace-server.ts‎

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { promisesasfs,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

‎electron-app/package.json‎

Lines changed: 28 additions & 28 deletions
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",

‎electron-app/webpack.base.js‎

Lines changed: 9 additions & 47 deletions
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

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /