Package peppy :: Module fundamental :: Class GenericFoldHierarchyMixin
[frames] | no frames]

Class GenericFoldHierarchyMixin

object --+
         |
        GenericFoldHierarchyMixin
Known Subclasses:

Mixin for the scintilla fold processing.

Scintilla's folding code is used to generate the function lists in some major modes. Scintilla doesn't support code folding in all its supported languages, so major modes that aren't supported may mimic this interface to provide similar functionality.

This mixin depends on the FoldExplorerMixin in peppy.lib.foldexplorer

Instance Methods
 
OnFoldChanged(self, evt)
Callback to process fold events.
 
getFoldHierarchy(self)
Get the current fold hierarchy, returning the existing copy if there are no changes, or updating if necessary.
 
updateFoldHierarchy(self)
Create the fold hierarchy using Stani's fold explorer algorithm.
 
getFoldEntryFunctionName(self, line)
Check if line should be included in a list of functions.

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties

Inherited from object: __class__

Method Details

OnFoldChanged(self, evt)

 

Callback to process fold events.

This callback is initiated from within the event handler of PeppySTC. The events could be used to optimize the fold algorithm, but currently this data is not used by anything.

getFoldEntryFunctionName(self, line)

 

Check if line should be included in a list of functions.

Used as callback function by the fold explorer mixin: if the line should be included in a list of functions, return True here. Because the scintilla folding includes a lot of other data than function calls, we have to cull the full list to only include lines that we want.

Parameters:
  • line - line number of the fold entry
Returns:
text string that should be used as function name, or "" if it should be skipped in the function menu