[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[Dltk-dev] I want to avoid reparsing by the AbstractASTFoldingStructureProvider...
|
Hi all,
Is there a good reason (I am sure there is but I did not get it) why
the AbstractASTFoldingStructureProvider is forcing a reparse of the
document? (The document has just been parsed a moment ago and saved
into the cache.) With the current implementation I have to to this
(the ugly way) to stop the reparsing:
@Override
protected CodeBlock[] getCodeBlocks(String code, int offset) {
ModuleDeclaration decl = null;
IModelElement element = fMyEditor.getInputModelElement();
if (element instanceof ISourceModule) {
decl = SourceParserUtil.getModuleDeclaration((ISourceModule)element);
}
return buildCodeBlocks(decl, offset);
}
where fMyEditor is another field just like the fEditor in
AbstractASTFoldingStructureProvider which unfortunatelly is private
and has no getter method.
Am I doing something wrong in my implementation? If not, could you
please either:
1. create a getter for the fEditor field in the
AbstractASTFoldingStructureProvider class
or
2. make the fEditor field protected
or.
3. (My preferred solution) make the getInputElement method protected.
Although, I would combine 3 + (1 or 2)
Regards,
Gabriel
--
MSc Gabriel Petrovay
MCSA, MCDBA, MCAD
Mobile: +41(0)787978034