chore(deps): update to theia@1.41.0 (#2211)

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
Akos Kitta
2023-09-29 18:40:13 +02:00
committed by GitHub
parent ce02e263ec
commit 8f4bcc83ec
12 changed files with 1431 additions and 1331 deletions

View File

@@ -29,7 +29,7 @@ export function createServer(
}
export async function startServer(server: http.Server): Promise<string> {
let portTimer: NodeJS.Timer;
let portTimer: NodeJS.Timeout;
function cancelPortTimer() {
clearTimeout(portTimer);

View File

@@ -7,13 +7,14 @@ import { HostedPluginReader as TheiaHostedPluginReader } from '@theia/plugin-ext
@injectable()
export class HostedPluginReader extends TheiaHostedPluginReader {
override readContribution(
override async readContribution(
plugin: PluginPackage
): PluginContribution | undefined {
): Promise<PluginContribution | undefined> {
const scanner = this.scanner.getScanner(plugin);
const contributions = scanner.getContribution(plugin);
const contributions = await scanner.getContribution(plugin);
return this.filterContribution(plugin.name, contributions);
}
private filterContribution(
pluginName: string,
contributions: PluginContribution | undefined

View File

@@ -1,8 +1,7 @@
import { promises as fs, constants } from 'node:fs';
import { injectable, inject } from '@theia/core/shared/inversify';
import { FileUri } from '@theia/core/lib/node';
import { inject, injectable } from '@theia/core/shared/inversify';
import { DefaultWorkspaceServer as TheiaDefaultWorkspaceServer } from '@theia/workspace/lib/node/default-workspace-server';
import { SketchesService } from '../../../common/protocol';
import { FileUri } from '@theia/core/lib/node';
import { IsTempSketch } from '../../is-temp-sketch';
@injectable()
@@ -21,26 +20,6 @@ export class DefaultWorkspaceServer extends TheiaDefaultWorkspaceServer {
return uri;
}
/**
* This is the async re-implementation of the default Theia behavior.
*/
override async getRecentWorkspaces(): Promise<string[]> {
const listUri: string[] = [];
const data = await this.readRecentWorkspacePathsFromUserHome();
if (data && data.recentRoots) {
await Promise.all(
data.recentRoots
.filter((element) => Boolean(element))
.map(async (element) => {
if (await this.exists(element)) {
listUri.push(element);
}
})
);
}
return listUri;
}
protected override async writeToUserHome(
data: RecentWorkspacePathsData
): Promise<void> {
@@ -69,15 +48,6 @@ export class DefaultWorkspaceServer extends TheiaDefaultWorkspaceServer {
recentRoots,
};
}
private async exists(uri: string): Promise<boolean> {
try {
await fs.access(FileUri.fsPath(uri), constants.R_OK | constants.W_OK);
return true;
} catch {
return false;
}
}
}
// Remove after https://github.com/eclipse-theia/theia/pull/11603