mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-13 06:16:33 +00:00
go to line.
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
parent
33af9b6005
commit
939a905a6b
@ -97,6 +97,7 @@ import { VerifySketch } from './contributions/verify-sketch';
|
||||
import { UploadSketch } from './contributions/upload-sketch';
|
||||
import { CommonFrontendContribution } from './customization/core/common-frontend-contribution';
|
||||
import { CopyToForum } from './contributions/copy-to-forum';
|
||||
import { GoToLine } from './contributions/go-to-line';
|
||||
|
||||
const ElementQueries = require('css-element-queries/src/ElementQueries');
|
||||
|
||||
@ -326,4 +327,5 @@ export default new ContainerModule((bind: interfaces.Bind, unbind: interfaces.Un
|
||||
Contribution.configure(bind, VerifySketch);
|
||||
Contribution.configure(bind, UploadSketch);
|
||||
Contribution.configure(bind, CopyToForum);
|
||||
Contribution.configure(bind, GoToLine);
|
||||
});
|
||||
|
@ -12,7 +12,7 @@ export class CopyToForum extends EditorContribution {
|
||||
registerCommands(registry: CommandRegistry): void {
|
||||
registry.registerCommand(CopyToForum.Commands.COPY_TO_FORUM, {
|
||||
execute: () => this.copyToForum()
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
registerMenus(registry: MenuModelRegistry): void {
|
||||
|
@ -0,0 +1,45 @@
|
||||
import { injectable } from 'inversify';
|
||||
import { EditorContribution, Command, MenuModelRegistry, KeybindingRegistry, CommandRegistry } from './contribution';
|
||||
import { ArduinoMenus } from '../menu/arduino-menus';
|
||||
|
||||
@injectable()
|
||||
export class GoToLine extends EditorContribution {
|
||||
|
||||
registerCommands(registry: CommandRegistry): void {
|
||||
registry.registerCommand(GoToLine.Commands.GO_TO_LINE, {
|
||||
execute: () => this.goToLine()
|
||||
});
|
||||
}
|
||||
|
||||
registerMenus(registry: MenuModelRegistry): void {
|
||||
registry.registerMenuAction(ArduinoMenus.EDIT__TEXT_CONTROL_GROUP, {
|
||||
commandId: GoToLine.Commands.GO_TO_LINE.id,
|
||||
label: 'Go to Line...',
|
||||
order: '6'
|
||||
});
|
||||
}
|
||||
|
||||
registerKeybindings(registry: KeybindingRegistry): void {
|
||||
registry.registerKeybinding({
|
||||
command: GoToLine.Commands.GO_TO_LINE.id,
|
||||
keybinding: 'CtrlCmd+L'
|
||||
});
|
||||
}
|
||||
|
||||
async goToLine(): Promise<void> {
|
||||
const editor = await this.current();
|
||||
if (editor) {
|
||||
const action = editor.getControl().getAction('editor.action.gotoLine');
|
||||
return action.run();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export namespace GoToLine {
|
||||
export namespace Commands {
|
||||
export const GO_TO_LINE: Command = {
|
||||
id: 'arduino-go-to-line'
|
||||
};
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user