On the beginning of the process of evaluating type hierarchy
the evaluating thread may freeze on a first call to
Snapshot::updateDependencyTable() for quite a long time
(e.g. when showing the type hierarchy for IPlugin class
inside Creator project - it may freeze up to about 3 seconds).
So, when we want to cancel the evaluation (e.g. when
we switch from "Type Hierarchy" into another view or when
closing Creator) we may freeze for this period. In order to
fix it we pass a future interface as an additional argument
for Snapshot::updateDependencyTable() and cancel the update
when cancellation of task was requested.
Change-Id: I2147f10a68989587476c30369ec2ac552a57d5ae
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Syntactically, they do have an initializer, but they are not
initializations.
Change-Id: I0556b279ce2d173868585cbce085b803c1cff285
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Static member functions cannot modify the object and therefore must not
be reported as writable references.
Note that this does not have an effect yet, as the function type lacks
information about the "static" specifier.
Task-number: QTCREATORBUG-24894
Change-Id: Ib04a17864a0ca5b7610579a2f5efbcfde257e08a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
... when looking up a member function for categorization.
Contrary to our expectation, the first entry in the lookup results is not
necessarily the best fit.
Task-number: QTCREATORBUG-24894
Change-Id: I1ba6dbebeecd8c4a24fa53194996271339018d9c
Reviewed-by: André Hartmann <aha_1980@gmx.de>
... from those without one, and display the former like write accesses.
Task-number: QTCREATORBUG-24894
Change-Id: I5e2d83b2a3ec4735054441c346687f97eeb039fb
Reviewed-by: André Hartmann <aha_1980@gmx.de>
There are a lot more problems in this area (e.g. with nested classes),
but let's tackle them one by one.
Fixes: QTCREATORBUG-24801
Change-Id: I4b3805ea6f8b28373925693650150bbd89508096
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Introduces a QuickFix settings page where the generation of getters and
setters can be customized. The settings can be saved into a file that can
go into a VCS. All QuickFixes that generate getter/setter/signals/
Q_PROPERTIES now use the same backend. QuickFixes that generate getters/
setters are now extended to also generate signals and Q_PROPERTIES.
Fixes: QTCREATORBUG-1532
Fixes: QTCREATORBUG-17941
Fixes: QTCREATORBUG-12678
Fixes: QTCREATORBUG-15779
Fixes: QTCREATORBUG-11620
Fixes: QTCREATORBUG-22707
Fixes: QTCREATORBUG-20157
Fixes: QTCREATORBUG-21804
Fixes: QTCREATORBUG-19814
Fixes: QTCREATORBUG-14622
Fixes: QTCREATORBUG-19803
Change-Id: I50ed2dad9b4a637fbd87b3e1f2856060ad0ad920
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Remove unneeded and wrong include paths which ended up as invalid
include paths in the exported QtCreatorTargets.cmake.
Add missing sqlite header.
Change-Id: Icce60037160ff06b032a03df47e6834422f86f57
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
...and thereby have less include paths per compile unit.
Change-Id: I70de8db12d881ea827595ca0cacaea13b5c0f3bd
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Text may contain special utf characters which in turn lets
the range of the token become different if handled as normal
byte. This would end up in an assert if the QStringView tries
to access a position after the last character of the text.
Amends 242579099a.
Change-Id: Ie52c15e8729f25da850b539a6a55cca134026c3d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
... when trying to find out the usage type of a function argument.
Otherwise, we potentially ignore functions which have additional
overloads with a shorter parameter list than is required for the call.
Change-Id: I02bf2cb359ea9d506e2644388234dc28fa072445
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
That is, find out whether a certain access was a read, a write, a
declaration or something else, and report the result to upper layers.
Follow-up patches can make this information visible to users.
Task-number: QTCREATORBUG-12734
Task-number: QTCREATORBUG-19373
Change-Id: Iee79e39dd1eb5a986a7e27846991e0e01b2c3a2f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
These overloads did not add any value, but were just confusing.
Change-Id: Icf3f69a30e2fccc4a4695e79bcf32457b2fb481b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
... if the first argument is a call to a function returning a pointer to
QObject.
Fixes: QTCREATORBUG-13265
Change-Id: I12c2d07331a0c6dca56ad55c518240fd74be3dca
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
It looks very much as though the original author simply forgot to add
that return statement.
Fixes: QTCREATORBUG-23881
Change-Id: Ie93d2451bf1b491d01137285f983d657133c81c3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Use the original offset only in the one place where it is relevant.
This amends commit 8eac3fba80.
Fixes: QTCREATORBUG-24221
Change-Id: Idcfc5ecc8a76c875c4f2ca5890d0ba95ce52a6e9
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Code snippet:
template<class T> struct MyStruct { int value; };
int main() {
auto s = MyStruct<int>();
s.value; // "value" is not found
}
This fixes find usages for unique_ptr declared as auto like this:
auto ptr = std::unique_ptr<MyStruct>(new MyStruct());
ptr->value;
Also fixes in-place constructors:
std::unique_ptr<MyStruct>(new MyStruct())->value;
Fixes: QTCREATORBUG-15364
Change-Id: I8d452a77fe85e63665ec8d4c4afbcf8aad063121
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
At some point in the preprocessing stage, some tokens get "squeezed", so
their associated string no longer refers to the document content, but
only to their own symbol. However, there is at least one context that
operated under the assumption that the token's offset still pointed into
the "global" string. As the token's offset is zero after parsing, this
lead to the same piece of code being preprocessed in an infinite loop.
Fixes: QTCREATORBUG-19525
Change-Id: I231ba51811cfa0b5c6dfe7f75fe0384472252c6f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Code snippet:
void bar(); // call find usages for bar from here
void foo(int bar); // bar from here should not be in results
Add test for member function false positives, that is part of
QTCREATORBUG-2176. That was already fixed before.
Fixes: QTCREATORBUG-2176
Change-Id: I9a079caa83bbaea1edb7ba6aeb151d4d4c77952f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
If one of the overloads had additional default arguments, then for each
of these, its priority was increased, which does not appear to make any
sense.
Fixes: QTCREATORBUG-17807
Change-Id: Id5be81ce52c615a424fe4314d2e50385b3fb2b1c
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Improve type printed for template specializations with numeric
or bool values.
Code example:
template<bool B, class T> struct enable_if{};
template<class T> struct enable_if<true, T>{ typedef T type; };
In outline: "enable_if<_Tp1, T> <T>" becomes "enable_if<true, T> <T>"
TemplateArgument class holds pointer to numeric literal owned
by CppDocument, so remove Control::squeeze() to not release
numericLiterals in CppDocument::releaseSourceAndAST()
This based on TemplateArgument class introduced in commit
9ee693ee22
Change-Id: Ib787a5e402c3e8d8467b520347a26afa6087d4bd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
These changes target Find Usages feature to work with shared_ptr.
Improve libs/3rdparty/cplusplus and plugins/cplusplus:
parse __declspec() attribute,
call to variadic function template without specified template arguments,
if constexpr,
c++11 attributes [[value]],
function templates with default parameters,
resolve order for function vs template with default parameter,
template operator->() with default arguments,
template specialization with numeric values,
find best partial specialization,
fix partial specialization for non-first specialized argument
Fixes: QTCREATORBUG-7866
Fixes: QTCREATORBUG-20781
Fixes: QTCREATORBUG-22857
Fixes: QTCREATORBUG-17825
Change-Id: I31a080f7729edfb2ee9650f1aff48daeba5a673b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Nikolai Kosjar <pinaceae.pinus@gmail.com>
This applies for e.g.
* "Add Definition..." (on function decl)
* "Move Definition..." (on function decl)
* "Insert Virtual Functions of Base Class" (on class specifier)
Fixes: QTCREATORBUG-11849
Fixes: QTCREATORBUG-19699
Change-Id: I0d259bc1782470f3b3f19617230005a5594a5cca
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>