I refactored a big part of the plugin code, joining all the EventListeners into the same handler and fixing some code style inconsistencies.
Investigating issue #48 reported by @glyph I noticed about how many times rope was compiling the code to generate the AST, when the autocompletion when typing is active it was several times per seccond .
Share the AST between calls is hard because the autocompletion stuff does use of the rope.base.ast.parse method to compile/parse part of the buffer in order to do his stuff. I finally added a cache decorator to the parse function in rope.base.ast module to share AST between save states and between autocompletions in order to save some time of compilation/parsing
The cache only caches 1MB of data, when this limit is reached then it uses a FIFO approach in order to save memory.
I refactored a big part of the plugin code, joining all the EventListeners into the same handler and fixing some code style inconsistencies.
Investigating issue #48 reported by @glyph I noticed about how many times rope was compiling the code to generate the AST, when the autocompletion when typing is active it was several times per seccond .
Share the AST between calls is hard because the autocompletion stuff does use of the rope.base.ast.parse method to compile/parse part of the buffer in order to do his stuff. I finally added a cache decorator to the parse function in rope.base.ast module to share AST between save states and between autocompletions in order to save some time of compilation/parsing
The cache only caches 1MB of data, when this limit is reached then it uses a FIFO approach in order to save memory.