Static members have a variable declaration kind so
we need to check their access specifiers in order to
provide proper information about tokens.
Fixes: QTCREATORBUG-22082
Change-Id: If455174bd346398a2df3499fa6cf1ea2b4e26965
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
The are not any more shown but they are still not shown for constructor
arguments because libClang is providing the wrong argument count.
Task-number: QTCREATORBUG-21543
Change-Id: If9b6140ed4b2dedf71bd94aae0a97669cdd04e67
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
With the upgrade to clang 7 these started to fail on Linux.
Something changed in clang regarding the processing of our
wrappedQtHeaders/QtCore/qobjectdefs.h. Since we can't rely on the
include paths of Qt in the tests anyway, inline the relevant
preprocessor directives into the test file to make the tests
independent of that.
Change-Id: Iba5cdc5483c3007346346d294374598a75fcb5a1
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Currently only operators have their own style but not
punctuation tokens. Make possible to highlight both.
Task-number: QTCREATORBUG-20666
Change-Id: I9533e0f1bef65b86c4e4f5c9756571103584124b
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Failing tests:
TokenProcessor.TemplateFunctionCall
TokenProcessor.TemplateClassDeclaration
Do not introduce fatal error in test source file.
Otherwise template function is not recognized anymore.
Such template calls were also broken before but could
provide a valid Cursor kind. So it's a minor regression
in Clang but does not change anything for Qt Creator user.
Bug is reported: https://bugs.llvm.org/show_bug.cgi?id=37550
Change-Id: I788e8d9f88141cfefc6bbde77f36c459d91aff0b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Color types and enable Ctrl+click for the functions
and types inside SIGNAL/SLOT macros.
Change-Id: Ic1c0b7372fe9a73c5607b1973d75a6656c75ef0e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
We used to style overloaded operators in the same way
as C++'s built-in operators. There was no way to tell
if a + token would call a operator+() function or not.
Now, if an operator is overloaded (redefined),
we give it the "Overloaded Operator"-mixin so users
can style it differently.
Note: Calls to overloaded 'new' and 'delete' are not
highlighted by "Overloaded Operator". This is because
clang today always maps these to CXCursor_CXXNewExpr
and CXCursor_CXXDeleteExpr with cursor.spelling == ""
(empty string). So there is no (?) quick way for us
to tell if a new/delete-token was overloaded or not.
After follow-ups, follow symbol will work for operator
overload usages in current translation unit.
Commit is appended by Ivan Donchevskii.
Task-number: QTCREATORBUG-19659
Change-Id: I157855d482a61ad2059642a1ee982089fcb7d312
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Add extra data to Keyword tokens.
Does not affect highlighting.
Change-Id: I206499ea35ee4ece5fe442665c904090cf5d90fc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Transform Q_PROPERTY into unique AST node.
Mark different parts with types and search for parent
in FullTokenInfos.
Change-Id: Iaa1ec0c73d34773edf5605d3682bd6a290d195de
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Data added:
- return type spelling for functions
- parent spelling
- access specifier for class fields and methods
- storage class
New highlighting types are added, therefore
types are now categorized by class, struct, etc.
Change-Id: I1739b94a6f777045fde655060d8b9a12b6e0889b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
...instead of the corresponding declaration color.
Task-number: QTCREATORBUG-18686
Change-Id: Ice4d84816351af79efa286f49516c392bd80da86
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This allows users to style function names at their definitions.
Once set, the XML-style token "FunctionDefinition" will
highlight all function definitions: the style option is a
mixin to Function and Virtual Function.
TEST=Default themes and locally hacked themes that lack Function,
FunctionDefinition, Declaration-styling look as they did before
this patch.
Requires Clang.
Task-number: QTCREATORBUG-16625
Change-Id: I49d8e401211bdf28ff74699feac16fe98f6d64ce
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This completes
commit a3a62e78f7
Clang: Fix highlighting of function in using declaration
Change-Id: I3c163096374d7a1f45a590bb8ebfe5f5a1f8d417
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
f(x.get()); -> x.get() should be shown as a output argument
Task-number: QTCREATORBUG-18591
Change-Id: I99f5637660bcd0a889338ebfa6737d79de226f87
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Non constant pointers are used many times as non output arguments, so you
get misleading information.
Task-number: QTCREATORBUG-18591
Change-Id: Ic5f987db44ad63a0b1a38fd59cd807db5f2acc8f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
In the example below, "var" is highlighted as a function, but it should
be highlighted as a local variable.
struct OtherOperator { void operator()(int); };
void g(OtherOperator o, int var)
{
o(var);
}
This is due to a libclang bug.
Change-Id: I7c9fcad6f16c25191d31fc330e969ebd282d4869
Reviewed-by: David Schulz <david.schulz@qt.io>
We get the source range for the parameter list and not the arguments
in the initializer list back. So we have to disable the test case.
Task-number: QTCREATORBUG-17101
Change-Id: I65ec6d111766b5728a951b024576cbf777c89728
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Constructors are not recognized by libClang as callable expressions.
Task-number: QTCREATORBUG-17101
Change-Id: I40eb46c07475e3b2e48bc8117de073732005f8b9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This adds a mix-in for writable functions arguments.
Change-Id: I758f7fef77d992ea25395db550571ccb081fd5fd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>