[PATCH] Re: Moving stuff for include-completion to kdevplatform
Milian Wolff
mail at milianw.de
Mon Aug 3 17:55:59 UTC 2009
Milian Wolff wrote:
> Hi again :)
>
> Cpp contains a lot of stuff which other language plugins could take
> advantage of. Right now I want to implement autocompletion for includes
> in PHP.
>
> What I think would be useful:
> - moving cpp/includeitem.h to kdevplatform:
> * would language/codecompletion be a sane place for that? Esp.
> considering that this header is used e.g. in some Cpp specific quickopen
> stuff. Maybe utils is a better place?
>
> - moving IncludeFileCompletionItem from cpp/codecompletion/items.h:
> * this should really go to language/codecompletion.
> * except for the execute() method it looks language independent. It
> should just be pure abstract or virtual.
>
> - moving IncludeNavigationContext to kdevplatform:
> * again - where to put this? language/util ?
> * we also should take a look at what can be reused and what not. Esp.
> the environment file info (number of declarations etc.) should be
> language dependent. Macros e.g. are Cpp specific. Just having the html()
> method virtual should be enough imo so it can be subclassed for language
> where required.
> * pickContextWithData() contains the lines:
>
> if(!ctx->parsingEnvironmentFile() ||
> ctx->parsingEnvironmentFile()->type() != KDevelop::CppParsingEnvironment)
> continue;
>
> so that generic IncludeNavigationContext has to be a template?
>
>
> Everything else should imo stay as it is and be reimplemented on a
> per-lang basis. Esp. getting reasonable list of include files is imo
> highly lang dependent. For PHP it has to work for remote projects, maybe
> honor a per-project setting for custom include paths etc. etc.
>
> I can work on the stuff above, but want some input first so I don't mess
> things up...
Here's a patch. Please review. I'll continue hacking on the PHP support
and will see whether the stuff works well.
--
Milian Wolff
http://milianw.de
More information about the KDevelop-devel
mailing list