mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-10 18:59:28 +00:00
Speed up IDE startup time.
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
@@ -23,7 +23,10 @@ import {
|
||||
Disposable,
|
||||
DisposableCollection,
|
||||
} from '@theia/core/lib/common/disposable';
|
||||
import { SketchesServiceClientImpl } from '../../../common/protocol/sketches-service-client-impl';
|
||||
import {
|
||||
CurrentSketch,
|
||||
SketchesServiceClientImpl,
|
||||
} from '../../../common/protocol/sketches-service-client-impl';
|
||||
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
||||
import { URI } from '../../contributions/contribution';
|
||||
|
||||
@@ -95,7 +98,7 @@ export class SketchbookWidgetContribution
|
||||
return this.openView() as Promise<any>;
|
||||
}
|
||||
|
||||
registerCommands(registry: CommandRegistry): void {
|
||||
override registerCommands(registry: CommandRegistry): void {
|
||||
super.registerCommands(registry);
|
||||
|
||||
registry.registerCommand(SketchbookCommands.OPEN_NEW_WINDOW, {
|
||||
@@ -142,7 +145,10 @@ export class SketchbookWidgetContribution
|
||||
// disable the "open sketch" command for the current sketch.
|
||||
// otherwise make the command clickable
|
||||
const currentSketch = await this.sketchServiceClient.currentSketch();
|
||||
if (currentSketch && currentSketch.uri === arg.node.uri.toString()) {
|
||||
if (
|
||||
CurrentSketch.isValid(currentSketch) &&
|
||||
currentSketch.uri === arg.node.uri.toString()
|
||||
) {
|
||||
const placeholder = new PlaceholderMenuNode(
|
||||
SKETCHBOOK__CONTEXT__MAIN_GROUP,
|
||||
SketchbookCommands.OPEN_NEW_WINDOW.label!
|
||||
@@ -186,7 +192,7 @@ export class SketchbookWidgetContribution
|
||||
});
|
||||
}
|
||||
|
||||
registerMenus(registry: MenuModelRegistry): void {
|
||||
override registerMenus(registry: MenuModelRegistry): void {
|
||||
super.registerMenus(registry);
|
||||
|
||||
// unregister main menu action
|
||||
|
||||
Reference in New Issue
Block a user