A structure outline defines a general outline information about the structure of the source code. It is in a tree hierarchy, meaning every outline element can have children of their own, and so on.
Each outline bears a label, which is usually displayed alongside the object in an IDE. A secondary information (type) is present for more optional short information which the IDE can display. These informations are usually displayed in the following format:
label : typewhere
": type"
is optional and might be using a different color for text display.
The outline defines two text ranges which are used to provide dynamic navigation to the user.
The offset-length pair will define the range of the corresponding source element for an outline object. When the user navigates in the source code, and the cursor is in the range, the corresponding outline object will be highlighted in the outline view.
The selection offset-selection length pair defines a range which is highlighted in the document when the user selects the outline object manually.
Example:
build_target { ... }When the user navigates the cursor inside the braces, the outline for
build_target
will be highlighted.
When the user selects the outline for build_target
, the preceding "build_target"
phrase
will be highlighted.
Outline tree objects should be constructed in a way that the positional information (offset and length) will be inside of the parent positional information. This ensures that the appropriate outline object will be highlighted when the user navigates through the code.
Usually the innermost outline object is highlighted.
The above mechanism for outline highlight in the IDE is a recommendation for IDE plugin implementation, but they might follow a different behaviour.
All offsets in this class is zero based, and work on decoded characters, not on raw byte data.
public default List< | Gets the children outlines for this object. |
public String | getLabel() Gets the label for the outline. |
public int | Gets the outline position length. |
public int | Gets the outline position offset. |
public default String | Gets the schema identifier string of the outline entry. |
public default Map< | Gets the schema related meta-data ssociated with this outline entry. |
public int | Gets the selection length. |
public int | Gets the selection offset. |
public default String | getType() Gets the type of this outline. |
The default implementation returns an empty list.
The label is the primary information about the outline object, should be short, and single line.
Similarly to ScriptStructureOutline, entries can also have schema identifiers. They can be used to differentiate various outline entries for IDE plugins.
See ScriptStructureOutline.getSchemaIdentifier() for more information.
E.g.:
"org.company.scripting.language.outline.entry.target"
null
if none.Similarly to ScriptStructureOutline, entries can also have meta-data defined for them. They can be used to convey various information about the given outline entry.
See ScriptStructureOutline.getSchemaMetaData() for more information.
null
, or empty.