Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 96b95928 authored by Milian Wolff's avatar Milian Wolff

Format comments before setting them on the DUChain

Summary:
This removes the /// and /* ... */ prefixes. Not only does this
make the stuff way more readable, it also fixes our JSON tests...

Return proper non-C++ specific includes/defines for non-project files

When we query the includes/defines for a file outside of any project
we always returned the C++ compiler includes/defines. This was because
we never tried to guess the language type then, since we operated only
on ProjectBaseItems pointers which are obviously nullptr for files
outside of any project. Instead, operate on QString path
representations like elsewhere in the IADM already. This allows us to
guess the language type even for C, ObjC and Cuda files when they are
not part of a project.

No unit test is added, but I found this while working on a separate
feature that has a proper unit test attached.

Handle _Complex types

We just create a delayed type that holds the string representation.
This is enough to get the type displayed in the tooltips and it also
removes the pesky warnings from the command line about unhandled
types.

Subscribers: kdevelop-devel

Differential Revision: https://phabricator.kde.org/D9472
parent 595ac59d
......@@ -597,7 +597,7 @@ struct Visitor
return t;
}
template<CXTypeKind TK, EnableIf<TK == CXType_Vector> = dummy>
template<CXTypeKind TK, EnableIf<TK == CXType_Vector || TK == CXType_Complex> = dummy>
AbstractType *createType(CXType type, CXCursor /*parent*/)
{
return createDelayedType(type);
......@@ -1353,6 +1353,7 @@ AbstractType *Visitor::makeType(CXType type, CXCursor parent)
#if CINDEX_VERSION_MINOR >= 38
UseKind(CXType_Float128);
#endif
UseKind(CXType_Complex);
case CXType_Invalid:
return nullptr;
default:
......
typedef enum { Zero, One } Foobar;
/// "identifier" : "foo"
static const Foobar foo = 0 == 1;
#include <complex.h>
/// "type" : { "toString" : "_Complex float" }
float complex f_z = I * I;
/// "type" : { "toString" : "_Complex double" }
double complex d_z = I * I;
/// "type" : { "toString" : "_Complex long double" }
long double complex ld_z = I * I;
/// "type" : { "toString" : "const _Complex long double" }
const long double complex c_z = I * I;
/// "type" : { "toString" : "volatile _Complex float" }
volatile float complex v_z = I * I;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment