EGL Development User Group - Group home

Code expansion

  

What’s code expansion?

Code expansion is a tool of EGL source code editor. It can be used for selecting EGL code during function extraction. For example, you want to select EGL code for function extraction; or copy/cut EGL code – you can use the tool for code selection then copy/cut the code

Code expansion is a tool for EGL source code editor. It can be used to select EGL code during function extraction. For example, you can use the code expansion tool to select EGL code and then copy or cut the selected EGL code.

How to use it?

There are 4 kinds of code expansion as listed below:

  • Enclosing element: Select the element that encloses the current selection.
  • Next element: Select the next sibling element of the current selection. If no next sibling   element is found, then the parent element will be selected.
  • Previous element: Select the previous sibling element of the current selection. If no previous sibling element is found, then the parent element will be selected.
  • Restore last selection: Restore to the latest selection.

They can be triggered by either short-cut keys or context menu:

  • Short-cut key:
  • Enclosing: Alt + Shift + Up
  • Next: Alt + Shift + Right
  • Previous: Alt + Shift + Left
  • Restore: Alt + Shift + Down
  • Context menu right click the editor, select  Expand Selection To Corresponding code selection action

image

 

 

 

 

 

Below is a sample that uses ‘Next element’ code expansion function:

  1. With the current selection, user is going to use Next elementimage
  2. Press “Alt + Shift + Right”, and the next element is selected.image
  3. Press “Alt + Shift + Right” to select next element. In below case, no next sibling element is available, so the parent   element is selected (in this case is the whole if statement). Now if user press Alt + Shift + Down, then the code selection will be restored.image
  4. With the whole if statement is selected, press “Alt + Shift + Right” toselect next element. Again, in this case, no next sibling element is available, so parent   element is selected (in this case is the whole if statement).image