Gathering the set of files-to-watch
Esben Mose Hansen
kde at mosehansen.dk
Sat Jun 12 19:04:21 UTC 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.
2. What featureset is appropriate for updating "everything stored" for a file
that was changed externally? I currently use
3. Does backgroundparser check if there is already a queued job for a given
url, or should I do that myself?
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 :)
Kind regards, Esben
More information about the KDevelop-devel