Features:Generation

From FlashDevelop

Jump to: navigation, search

Contents

Features Tour

Interface | Code completion | Code generation | SWF/SWC exploration | Code documentation

Code generation

Shortcut


Generate fields from function parameters

2i-members-from-params.gif
  • Place your cursor on a function parameter name and press Ctrl+Shift+1 to generate Class members corresponding to the function parameters.

Import declaration generation

Method override generation

2h-override-generation.gif
  • In AS3, type 'override'-space and select a method in the list:
  • The method signature and body will be generated (including super call).
  • Notice that the required imports will automatically be added to your code.

Event handlers generation

2a-events-generator.gif
  • Write a regular addEventListener call, move your cursor on the (missing) handler's name and press Ctrl+Shift+1 to generate the event handler.
  • This works also with AS2 Delegate handlers.
  • New: FlashDevelop can completely generate the event handler name too:
    addEventListener(type, <Ctrl+Shift+1>

Getter/setter generation

2b-getset-generator.gif
  • Move your cursor on a non-public variable declaration and press Ctrl+Shift+1 to generate the appropriate getter/setter.
  • The property name is automatic: for a variable called "_somevar", "$somevar", "mc_somevar" or "somevar_txt", the property will be called "somevar".
  • If the variable doesn't have a '_' or a '$' in its name, then it will be renamed: a variable "somevar" would be renamed as "_somevar".

Unknown members generation

2e-basic-generation.gif
  • Move your cursor on a non-declared variable or function and press Ctrl+Shift+1 to generate the member.
  • Generator will offer to generate: const (new), variable, function or class (new).
  • New: generator can declare new elements in other classes.
  • New: function generation will take automatically detect the parameters types.

Local variables promotion

2f-promote-local-vars.gif
  • Move your cursor on a local variable inside a function and press Ctrl+Shift+1 to declare this variable as a class member or as a parameter of the current function (new).
  • This even removes the local declaration in the function.
  • New: FlashDevelop will also offer to "move the variable(s) declaration" at the beginning of the function body.

Interface methods implementation

2d-interface-implementation.gif
  • Move your cursor on an interface type and press Ctrl+Shift+1 to generate the required interface methods.
  • Notice that the required imports will automatically be added to your code.

Snippets

2g-snippets.gif
  • Code snippets are chunks of code that you often need to insert in your code.
  • Press Ctrl+B to expand a code snippet or view the snippets list.
  • Snippets can be smarter by using contextual "variables".
  • FlashDevelop includes a Snippets editor (puzzle button in the toolbar).

More?

See SWF/SWC exploration

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox