Gathering the set of files-to-watch

Milian Wolff mail at milianw.de
Sat Jun 12 19:59:26 UTC 2010


Esben Mose Hansen, 12.06.2010:
> On Wednesday 09 June 2010 22:23:39 Andreas Pakulat wrote:
> > > so having done my initial study, I'm diving into the code of KDevelop
> > > itself.  What I want to get is a maintaned list of all files in the
> > > project. Any files they depend on is a bonus at the first take, though
> > > I'll need those in time as well. I want to use this to build a list of
> > > files that needs watching, so that they can be automatically reparsed
> > > when changed. By doing this, I hope to get to a state where renaming,
> > > find-uses and other stuff actually works most of the time.
> 
> [...]
> 
> > You can get at all files from a project from IProject::fileSet() and
> > you get to all projects using the IProjectController.
> 
> Ok, so far so good. My patch watches the files added/removed to the
> fileSet, and schedules a reparse whenever these files are changed. There
> are some details left in this, but it basically works.
> 
> A few question:
> 
> 1. What would be a suitable priority? From reading the docs, 0 seems to
> high as I want these jobs to not interfere with the actively edited
> document, so I've used "10", for no particular reason other than it is a
> lower priority.

Use something _very_ low. Maybe 30 or something. Afaik 10 is the default for 
project files that are not yet parsed. Reparsing something is imo of lesser 
priority.

> 2. What featureset is appropriate for updating "everything
> stored" for a file that was changed externally? I currently use
> TopDUContext::AllDeclarationsContextsUsesAndAST .

Assuming that file was already parsed once you should check the features of 
that existing version and reuse them. Otherwise use the default which would be 
without uses and ast afaik. AST is definitely not required by default.

> 3. Does backgroundparser check if there is already a queued job for a given
> url, or should I do that myself?

It's done automatically.

> My next item on the list is getting and watching the includes of a file.
> The cleanup, and finally I'll submit it to the mercy of the core
> developers :)

I'm interested in it. How many watchers do you setup now for a medium sized 
project? E.g. kdevplatform + kdevelop?

-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20100612/f888f173/attachment.sig>


More information about the KDevelop-devel mailing list