Speed up IDE startup time.

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
Akos Kitta
2022-05-20 12:11:23 +02:00
committed by Akos Kitta
parent cb50d3a70d
commit 4c55807392
179 changed files with 2692 additions and 2022 deletions

View File

@@ -4,7 +4,7 @@ import { EditorCommandContribution as TheiaEditorCommandContribution } from '@th
@injectable()
export class EditorCommandContribution extends TheiaEditorCommandContribution {
@postConstruct()
protected init(): void {
protected override init(): void {
// Workaround for https://github.com/eclipse-theia/theia/issues/8722.
this.editorPreferences.onPreferenceChanged(
({ preferenceName, newValue, oldValue }) => {

View File

@@ -1,9 +1,7 @@
import { EditorManager as TheiaEditorManager } from '@theia/editor/lib/browser/editor-manager';
export class EditorManager extends TheiaEditorManager {
protected getOrCreateCounterForUri(): number {
protected override getOrCreateCounterForUri(): number {
return 0;
}
}

View File

@@ -0,0 +1,11 @@
import { injectable } from '@theia/core/shared/inversify';
import { EditorNavigationContribution as TheiaEditorNavigationContribution } from '@theia/editor/lib/browser/editor-navigation-contribution';
@injectable()
export class EditorNavigationContribution extends TheiaEditorNavigationContribution {
override async onStart(): Promise<void> {
// No await.
// Restore the navigation history asynchronously.
super.onStart();
}
}

View File

@@ -3,7 +3,10 @@ import URI from '@theia/core/lib/common/uri';
import { EditorWidget } from '@theia/editor/lib/browser';
import { LabelProvider } from '@theia/core/lib/browser';
import { EditorWidgetFactory as TheiaEditorWidgetFactory } from '@theia/editor/lib/browser/editor-widget-factory';
import { SketchesServiceClientImpl } from '../../../common/protocol/sketches-service-client-impl';
import {
CurrentSketch,
SketchesServiceClientImpl,
} from '../../../common/protocol/sketches-service-client-impl';
import { SketchesService, Sketch } from '../../../common/protocol';
import { nls } from '@theia/core/lib/common';
@@ -16,9 +19,9 @@ export class EditorWidgetFactory extends TheiaEditorWidgetFactory {
protected readonly sketchesServiceClient: SketchesServiceClientImpl;
@inject(LabelProvider)
protected readonly labelProvider: LabelProvider;
protected override readonly labelProvider: LabelProvider;
protected async createEditor(uri: URI): Promise<EditorWidget> {
protected override async createEditor(uri: URI): Promise<EditorWidget> {
const widget = await super.createEditor(uri);
return this.maybeUpdateCaption(widget);
}
@@ -28,7 +31,7 @@ export class EditorWidgetFactory extends TheiaEditorWidgetFactory {
): Promise<EditorWidget> {
const sketch = await this.sketchesServiceClient.currentSketch();
const { uri } = widget.editor;
if (sketch && Sketch.isInSketch(uri, sketch)) {
if (CurrentSketch.isValid(sketch) && Sketch.isInSketch(uri, sketch)) {
const isTemp = await this.sketchesService.isTemp(sketch);
if (isTemp) {
widget.title.caption = nls.localize(