mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-10-16 06:48:32 +00:00
GH-297: Fixed the open from Sketchbook
handler.
When running the handler for the `Sketchbook` menu, do not clone the sketch. Closes #297 Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { CommandHandler } from '@theia/core/lib/common/command';
|
||||
import { CommandRegistry, MenuModelRegistry } from './contribution';
|
||||
import { ArduinoMenus } from '../menu/arduino-menus';
|
||||
import { MainMenuManager } from '../../common/main-menu-manager';
|
||||
import { NotificationCenter } from '../notification-center';
|
||||
import { Examples } from './examples';
|
||||
import { SketchContainer } from '../../common/protocol';
|
||||
import { OpenSketch } from './open-sketch';
|
||||
|
||||
@injectable()
|
||||
export class Sketchbook extends Examples {
|
||||
@@ -43,4 +45,13 @@ export class Sketchbook extends Examples {
|
||||
this.registerRecursively([...container.children, ...container.sketches], ArduinoMenus.FILE__SKETCHBOOK_SUBMENU, this.toDispose);
|
||||
}
|
||||
|
||||
protected createHandler(uri: string): CommandHandler {
|
||||
return {
|
||||
execute: async () => {
|
||||
const sketch = await this.sketchService.loadSketch(uri);
|
||||
return this.commandService.executeCommand(OpenSketch.Commands.OPEN_SKETCH.id, sketch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user