How can I associate a codemodel item with its language?

Milian Wolff mail at milianw.de
Mon Aug 31 19:01:00 UTC 2009


David Nolden, 31.08.2009:
> Am Mittwoch 26 August 2009 01:30:02 schrieb Milian Wolff:
> > I want to add per-language grouping to the class browser, but am stuck:
> >
> > It uses the CodeModel to get the items, but how do I decide to which
> > language a given item is associated? Not even declarations / contexts
> > seem to have any association with a language...
>
> Top-contexts have an association to the language.
>
> The problem is that you cannot access those from within the code-model
> right now I think.
>
> So the simplest way would be using the file-extensions to do the filtering,
> as that is basically all that is known at that point.
>
> Greetings, David

I don't like this workaround, maybe I should fix the real issue? Or would 
associating the language with a code model result in increased disk-size for 
the repo again or something like that?

I mean grouping by file extension could potentially really be error prone, lets 
do it correctly and use the information we have... And I bet accessing the 
topducontext for every class would be too slow, right?

Though I have to admit that even in the TopDUContext I wouldn't have the 
slightest clue how to get it's language plugin to query ::name()...

The only thing I know of is the ParsingEnvironmentFilePointer, but that is 
per-url. I bet this would be a problem as soon as we have e.g. JavaScript 
support and files where we have both, JavaScript declarations and PHP 
declarations in the same file (somewhat ugly imo but you never know what users 
do...).

Can you give me some pointers on how/where to integrate something like 
ParsingEnvironmentFilePointer for CodeModel items?
-- 
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: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20090831/f2433c3f/attachment.sig>


More information about the KDevelop-devel mailing list