Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[Dltk-dev] Re: Re: IModelElement cache needs to be cleared when rebuilding a project AND Rebuilding not working triggered for opened source modules

Hi Alex,

1. Yes, SourceParserUtil.clearCache() is a way to do it, but I was
trying to avoid this since, for example, when there are many projects
in the workspace, you don't want to clear the cache (even though
changing the preferences/properties is not a very often met behavior).
Although SourceParserUtil.clearCache() is a good candidate when
preferences are changed that affect the whole workspace.


2. I also like your idea of having DLTK handling preferences affecting
the parser behavior. :) Also regarding the parsing behavior, it is
very awkward to get the project handle in the
AbstractSourceParser.parse() method. This is because you are passing
the file name in a char[]. Therefore one has to use this construct to
get a project handle:

ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(new
String(fileName))).getProject();

This is needed in order to get the project properties. The automatic
DLTK handling of properties that affect parser would avoid such
constructs. Another option would be to pass a IFIle or IPath instead.


3. Currently I solved my problem (see previous e-mails) by
implementing my own AbstractBuildParticipantType (for the parser
buildParticipant extension). Although, I don't like when I have to
work with *internal* DLTK classes (e.g. ModelManager). The build
method of my IBuildParticipant, ignores a cache if the build is of
type FULL_BUILD. I hope this is a good solution for this and that this
does not have performance side-effects..

Regads,
Gabriel


----- Original Message -----

Hi Gabriel,

Also there is an AST cache, and most probably it affects your use case.
You can clear it completely with
org.eclipse.dltk.core.SourceParserUtil.clearCache() call.

Probably it should be handled automatically on DLTK side for
preferences affecting parser.
Let's discuss it.

Regards,
Alex


-- 
MSc Gabriel Petrovay
MCSA, MCDBA, MCAD
Mobile: +41(0)787978034


Back to the top