Weird API
Aleix Pol
aleixpol at kde.org
Sun Aug 31 01:51:02 UTC 2014
Hi,
I've just realized that there's some kind of omnipresent concept in the
DUChain called "ParseSession".
All language implementations I've looked at implement it but then it's not
documented anywhere (AFAIK). I've been looking through the code further,
then I realized there's the AbstractUseBuilder header file. This one
instantiates some ParseSession as a template argument and does weird things
with it [1]. And by weird things, I mean Adding an attribute called
m_mapAst and then expecting the availability of an API such as:
LanguageSpecificUseBuilderBase::editor()->parseSession()->mapAstUse.
I don't really think this is acceptable API. Or maybe it's just that I
don't feel like implementing a ParseSession concept in my plugin only
because of that, so I would like to have your feedback.
As a naïve suggestion, alternatively this API should be added to the
UseBuilder, both the mapAst attribute and the mapAstUse could be specified
within the AbstractUseBuilder. If the implementation decides to call a
ParseSession indoors, then it stays as an implementation detail.
Good night and happy hacking!
Aleix
[1]
https://www.nerdist.com/wp-content/uploads/2014/05/shia-labeouf-magic-gif.gif
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140831/edf03066/attachment.html>
More information about the KDevelop-devel
mailing list