RFC: make openDeclaration take an Identifier instead of QualifiedIdentifier
Milian Wolff
mail at milianw.de
Thu Apr 20 11:06:52 UTC 2017
On Dienstag, 11. April 2017 05:10:04 CEST Nicolás Alvarez wrote:
> Hi devs,
Hey,
sorry for the late response.
> I'm trying to improve some suboptimal APIs in KDevPlatform. If we're
> not going to keep compatibility from one 5.x to the next, we might as
> well use that to our advantage and improve our interfaces.
+1
> AbstractDeclarationBuilder::openDeclaration takes a
> QualifiedIdentifier. QIDs have multiple components giving the whole
> scope of the identifier. However, the first thing openDeclaration does
> is Identifier localId = id.last(); keeping the last component of the
> QualifiedIdentifier, and then uses that localId to create the
> Declaration. The rest of the QID is completely ignored. In addition,
> the language plugins I looked at seem to always pass a
> QualifiedIdentifier with zero or one components.
>
> So it seems there's no point in having openDeclaration take a
> QualifiedIdentifier, and it should take an Identifier instead. It
> should be trivial to adjust language plugins to the change;
+1
> unless
> some plugin is passing QualifiedIdentifier(str) where str could be
> "foo::bar", in which case the changes could become a bit more
> extensive to ensure only the last component is passed to Identifier().
I suggest you implement the above and see if it's actually being used or not.
If not, cool. If it is used, you can still call openDeclaration(qid.last()).
> (I think parsing C++-specific syntax like :: in QualifiedIdentifier is
> complete nonsense, but that's a whole different topic)
+1
> Please let me know agreement/disagreement on the idea and I'll send a patch.
>
> There is a similar "problem" with Contexts, but it's much trickier so
> I'll leave it for a separate email.
Cheers
--
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: 195 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20170420/822b7259/attachment-0001.sig>
More information about the KDevelop-devel
mailing list