Adding new files to background parser

Milian Wolff mail at milianw.de
Mon Jul 26 22:17:07 UTC 2010


On Monday 26 July 2010 22:35:29 Andreas Pakulat wrote:
> On 26.07.10 21:12:42, Milian Wolff wrote:
> > On Monday, 26. July 2010 20:50:53 Andreas Pakulat wrote:
> > > On 14.07.10 18:45:01, Milian Wolff wrote:
> > > > Actually listening to the ProjectModels signals inside the background
> > > > parser directly and honoring the setting would of course be even
> > > > better, but I wonder when the sig/slot connection should be setup.
> > > > Right now there is this
> > > > 
> > > >         KJob* parseProjectJob = new
> > > >         KDevelop::ParseProjectJob(project);
> > > > 
> > > > setup in the ProjectController, which would of course lead to doubled
> > > > adds (I know the background parser can cope with that, but it's just
> > > > unneeded overhead, isn't it?).
> > > 
> > > I don't see how that would work as the job is not persistent. What
> > > happens if I do a git pull 4 hours after opening the project... Or do
> > > you mean make the projectcontroller create a new such job every time
> > > the filesAdded signal is emitted? That seems like a lot of waste as
> > > even just iterating the files (from the parser) to check wether
> > > parsing is necessary takes 'ages' :)
> > 
> > Not a ParseProjectJob of course, "only" a normal parsejob for each added
> > / removed file. I thought by using the signals I could prevent doubled
> > code in all the project managers.
> 
> Hmm, thats true. Dunno which way I'd choose personally (locality of code
> that adds new files vs. reducing code-duplication). Hmm, what about
> doing it inside the items themselves? That is, if an item is added to a
> parent it could schedule its file for re-parsing.
> 
> Also reparsing removed files is not really necessary right? Rather the
> files using it would need re-parsing?

Yes, I like the idea. I'll see on when I get around to make the required 
changes.

Thanks for the feedback Andreas.

> > > IMHO scheduling a new parse-job from the manager when a file is
> > > added is totally fine. Bonus points if (in case of removal) it
> > > first fetches all files using the removed file (i.e. #include'ing it)
> > > and scheduling them for removal too :)
> > 
> > If you answer the above question,
> 
> Not sure which question you mean.

The implicit question on where to put the code.

> > I'm ok with adding it to the manager. But you surely mean "scheduling
> > them for reparsing" right? :P
> 
> Well of course, but unless I'm mistaken "scheduling a new parse-job for
> file X" is the same as "scheduling X for re-parsing" right on the
> technical level?

Yes, but you wrote, and I quote: "scheduling them for removal" :P

Good night.
-- 
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/20100727/c0cf81e3/attachment.sig>


More information about the KDevelop-devel mailing list