Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] calls to parse method of source parser

How does the cached AST get invalidated?  I need to get the cache invalidated as part of dependency tracking.  Dependent files are now getting queued for rebuild (using recordDependency + recordStructuralChange), but the build is short-circuited by the existence of cached AST.

On Sep 26, 2011, at 2:06 AM, Andrey Sobolev wrote:

> Hi Sebastian,
> 
> This is normal situation and DLTK has caching for AST's implemented.
> 
> With default implementations parser are used from many places:
> 1. To build structure model
> 2. To build index
> 3. for folding in editors.
> 4. semantic highlighting.
> 5. selection/completion
> .. etc.
> 
> To get ModuleDeclaration we call for org.eclipse.dltk.core.SourceParserUtil.parse(ISourceModule, IProblemReporter) methods.
> Please check to use same method to retrieve AST. Then parsing will be performed only one time, per source module change.
> 
> Best regards,
> Andrei Sobolev.
> 
> 21.09.2011 22:56, Sebastian Rheinnecker пишет:
>> 
>> Hi,
>> 
>> whilst working on the other problem ;) i have another question:
>> Everytime the parser should be called (after changes in the editor or
>> at startup and so on) the parse Method is called _twice_! You can see
>> that from prints to the console. Is this supposed to be? Otherwise
>> this would be a hard hit to the overall performance.
>> 
>> thanks in advance,
> 
> _______________________________________________
> dltk-dev mailing list
> dltk-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/dltk-dev



Back to the top