Better documentation / restrictions on enum values for Declaration IDs

Milian Wolff mail at
Mon Jun 14 13:56:46 UTC 2010

On Monday, 14. June 2010 15:49:07 Milian Wolff wrote:
> On Monday, 14. June 2010 15:36:33 Milian Wolff wrote:
> > On Monday, 14. June 2010 15:20:21 David Nolden wrote:
> > > Yes I guess we should document it. However clashing IDs should lead to
> > > an assertion very early, in the exact moment that the declaration is
> > > registered to the DUChain (which usually is done during static
> > > initialization), so at least the problem is not hard to debug.
> > > 
> > > The problem is that, for efficiency reasons, the values shouldn't
> > > become too high, as currently KDevelop uses a simple array to map
> > > declaration-ids to their factories, and using something slower like a
> > > hash-map in that very frequently accessed place would suck.
> > > 
> > > So maybe we should just enumerate all the languages that come into our
> > > mind, and give each language a range of 10 IDs. Should it ever be
> > > required, we can then assign additional ranges, but we should manage
> > > them centrally to prevent clashes.
> > 
> > I'll document the languages we have right now and assign them ranges of
> > 10.
> > 
> > I hope we don't get much more in PHP since we already have 8 I think ;-)
> > 
> > BTW: Anything stored in the DUChain has such a Identity, right? Also
> > contexts etc. pp., or?
> The ranges are currently quite a mess and not really ordered by language.
> See bottom of this mail for a list. What I see is that I have to fix
> erlang. And Java is imo too low, isn't it? Or should I pack XML, Erlang
> into 40 and 50? CSharp into 60?

Ah but looking at it, I see this:

UnsureType (KDevplatform) is in the 30's area,

PHPs types are in the 50's area

Types, Contexts and Declarations are all stored in the same registrator, 
right? Meaning they must have distinct identities?

What are the limitations for changing the Identities? I expect I'd have to 
increase the DUChain version so that it gets reparsed to prevent crashes?

If so I'd restructure _all_ identities and reserve the first 50 (we already 
have 27) for KDevplatform. Then I'd put the languages there in batches of 10 
(or should I increase that already? Cpp has 7, PHP has 8 custom Identities 

Milian Wolff
mail at
-------------- 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: <>

More information about the KDevelop-devel mailing list