D15530: kdev-clang : somewhat more complete ObjC(++) support

Milian Wolff noreply at phabricator.kde.org
Thu Jan 24 15:56:03 GMT 2019


mwolff requested changes to this revision.
mwolff added a comment.
This revision now requires changes to proceed.


  please add tests for the features you add - it's probably enough to add one or two files to `tests/files/` and use the JSON comments to verify everything is parsed properly?

INLINE COMMENTS

> builder.cpp:1207
>      m_uses[m_parentContext->context].push_back(cursor);
> -    return cursor.kind == CXCursor_DeclRefExpr || cursor.kind == CXCursor_MemberRefExpr ?
> +    return cursor.kind == CXCursor_DeclRefExpr || cursor.kind == CXCursor_MemberRefExpr || cursor.kind == CXCursor_ObjCMessageExpr?
>          CXChildVisit_Recurse : CXChildVisit_Continue;

space before ?

> cursorkindtraits.h:62
> +// kinds from the isClass function above?!)
> +// TODO: remove this comment.
> +constexpr bool isClassNoObjC(CXCursorKind CK)

so can this be removed? if not, what compile errors do you get?

> parsesession.cpp:94
>      QMimeDatabase db;
> -    if(db.mimeTypeForFile(path).name() == QStringLiteral("text/x-objcsrc")) {
> -        return {QByteArrayLiteral("-xobjective-c++")};
> -    }
> -
> +    QString mimeType = db.mimeTypeForFile(path).name();
>      // TODO: No proper mime type detection possible yet

`const auto mimeType = ...`
and then move down to where this is actually used

> parsesession.cpp:113
>          defaultArguments.append(QByteArrayLiteral("-nostdinc++"));
>          defaultArguments.append(QByteArrayLiteral("-xc++"));
>  

by moving down the check you break this path, but apparently that will only show up in unit tests

> parsesession.cpp:132
>  
> -    result.append(parserSettings.isCpp() ? QByteArrayLiteral("-xc++") : QByteArrayLiteral("-xc"));
> +    if (mimeType == QStringLiteral("text/x-objc++src")) {
> +        result.append(QByteArrayLiteral("-xobjective-c++"));

... but do we really want to move these checks down here? is it OK to pass the -nostdinc command e.g. for objc?

> kdevclang.xml:67
> +        <comment>Objective-C++ source code</comment>
> +        <comment xml:lang="ar">شفرة مصدر الهدف-C</comment>
> +        <comment xml:lang="ast">códigu fonte en Objective-C++</comment>

remove all the translations, the KDE translation team will handle this

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D15530

To: rjvbb, #kdevelop, mwolff
Cc: mwolff, aaronpuchert, kossebau, kdevelop-devel, glebaccon, hase, antismap, iodelay, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20190124/b02c39e5/attachment-0001.html>


More information about the KDevelop-devel mailing list