... to "warnings from build system".
It seems appropriate to respect the project settings by default.
Change-Id: I397c252409a012f4663f3752c5c097fa0e658da4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
That is, make SearchResultItem the one data type for adding search
results.
This will allow us to add additional properties to search results
without adding more and more parameters to a bunch of functions.
Change-Id: Ic2740477ae47449cee75caa2525727fe2b460f91
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Not a use case anymore, and if it were, we'd do it using built-in
capabilities.
Change-Id: I4c588ad7fb282530880210cb4c5795677074b1e0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Make this method just virtual, not a pure virtual.
Remove all empty reimplementations of this method.
Change-Id: Idf10e492355e8519172facd421ea0b2b13ce3b80
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
That is, show which ":" belongs to which "?" when the cursor is on one
of them.
Fixes: QTCREATORBUG-1410
Change-Id: Ie19360b3dfc82d92c264d99a5aa1864eda66e5c8
Reviewed-by: David Schulz <david.schulz@qt.io>
These were not showing up in any global symbol list so far.
Fixes: QTCREATORBUG-5800
Change-Id: I8e5c3b9b26f09d8cbcd31431e28c103da05d9bf8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
... when inserting a member function declaration for a definition.
Fixes: QTCREATORBUG-5591
Change-Id: Ie85b435a1595832d0085abdcc0a4187d939820e0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
... to the "Find Usages" result widget.
Fixes: QTCREATORBUG-25302
Change-Id: If957cbffe55f6f9288ceae9d64847e8a4a367765
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
... when the ClangCodeModel is disabled.
The built-in highlighter's use of HighlightingResult::kind conflicted
with the ClangCodeModel's.
Amends d8c1e51bfe.
Change-Id: I79784679fd17d88cd543304de726f8576954b29c
Reviewed-by: David Schulz <david.schulz@qt.io>
... classes and functions.
The extra info is usually the scope or the file, so this effectively adds
some helpful grouping.
Fixes: QTCREATORBUG-2538
Change-Id: I2404fee1df88fc51871a72db0dcc9c75d6ba6dcb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Unify setting saving. Do not write settings that stay at the default, so
defaults could change and take effect.
For this we explicitly differentiate between default and user settings.
Make QJsonDocument the basis for saving settings, because QDataStream
cannot really handle structured data where parts could be missing.
Write locator settings to a different settings group, so we do not
destroy reading older settings from older Qt Creator versions.
Task-number: QTCREATORBUG-24762
Change-Id: I5909e2d79313f6fc26159bb644fdfb43781b6c38
Reviewed-by: David Schulz <david.schulz@qt.io>
Avoid a crash when double click in hierarchy view
after the session has been changed or when the filename
changed.
Change-Id: Iebd7a99c220737262c79ade43c4ee8d11dcc037f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
That is, if the user specifies a custom base class, we check whether its
constructor takes a "QObject *parent" parameter, and if it does, we give
the derived class one as well.
This is technically a heuristic, but the pattern is pretty stable in the
Qt world.
Fixes: QTCREATORBUG-25156
Change-Id: Ie64440929df61cca7258d6d692c5de62970f9a65
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
... in template declarations and instantiations.
Fixes: QTCREATORBUG-16799
Change-Id: I82bc6411ca980ecbe2a6c70ae37580166a4b89e9
Reviewed-by: David Schulz <david.schulz@qt.io>
Avoid writing defaults to the settings.
Task-number: QTCREATORBUG-24430
Change-Id: I8e1d5a5b8ca21ef96a68a4d71a7d97d138bd186b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
... and make use of it to let users filter C++ "find references" results
by access type.
Fixes: QTCREATORBUG-19373
Change-Id: Ib5cadde1cfd235026d8e69da51daa6374808d3f3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This seems safe, as the arguments to the async function that the future
results from are values and shared pointers, so there does not appear to
be a need for this object to stay around while it finishes.
Fixes: QTCREATORBUG-25121
Change-Id: Ib498551856942bf7c3d05c3013e12ad6d90fd762
Reviewed-by: David Schulz <david.schulz@qt.io>
Clang code model can break if CMake project uses precompiled headers.
QtCreator will make a copy of the precompiled header, this way it
will not conflict with the build system one.
Ammends 888ea6bbbb
Fixes: QTCREATORBUG-24945
Fixes: QTCREATORBUG-25213
Change-Id: I149fc416cd047683d095758a024de47c7baf681c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Separate the use of CppElementEvaluator for CppHoverHandler from
the use for CppTypeHierarchyWidget. They are in fact much
different things.
Fix CppHoverHandler (enabled when ClangCodeModel plugin is disabled)
showing tooltips for symbols other than class or template.
Fix CppHoverHandler showing full template arguments for typedefs.
Change-Id: I5c44016014749d0d958b91a9a1ee9b35d3ea5eaa
Reviewed-by: hjk <hjk@qt.io>
Make it possible to show type hierarchy for
typedefs and unsings. Before, no type hierarchy
was shown.
Change-Id: I63ffa9c544072d66c42de8edf306c898d2fa90cb
Reviewed-by: hjk <hjk@qt.io>
In case we already visited the same base class symbol in the same
scope we already know the fully qualified name for base class,
so no need to search it again. We store all visited symbols
with their scopes in cache. This speeds up building type hierarchy,
especially for large trees, like for creator project and showing
type hierarchy for QObject: build time before this change was
about 300 sec, now it's about 130 sec.
Sometimes the old code didn't follow properly base classes
that were typedefs to other classes (like in creator project:
Debugger::Internal::RegisterHandler is derived from RegisterModel,
and RegisterModel is a typedef to Utils::TreeModel). This caused
that some subclasses were omitted form resulting type hierarchy.
E.g. type hierarchy in creator project for QObject lacked
about 8 subclasses.
Change-Id: I03c5aef65b7d7cb0ed279d3558aebc8a55e856b4
Reviewed-by: hjk <hjk@qt.io>
Make it possible to open type hierarchy for different
class selected from Type Hierarchy editor.
Make it available under context menu or on double click
on class name (single click opens the class in cpp editor window
as before). Double click doesn't expand / collapse items anymore
(expanding available when pressing the visual arrow).
Make navigation to editor more up to date - e.g. when linked location
changed in meantime (source file was edited), it tries to find
linked symbol quickly again (we introduce a small delay, up to
100-200 ms, depending on source file).
Change-Id: Ifb4fd58e853589a17cd14be465b3a7695fa48193
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Drop CppTools namespace when being in this namespace.
Move a call to filesDependingOn() into buildDerived().
Make filesDependingOn() a static method.
Change-Id: I6139f87597286bddf8298b06f8cf492066c8bedd
Reviewed-by: hjk <hjk@qt.io>
Add QFutureSynchronizer for collecting all running
futures (including those already canceled, but not finished yet).
It could happen, that we cancel the future, while
the associated task still needs some time in order
to catch the cancel request. When a d'tor of synchronizer
is run it cancels and waits for all pending futures
to be finished.
Add extra check for isCanceled() after a call to
updateDependencyTable(). In case the cancel was detected
inside updateDependencyTable(), we should return immediately.
Don't leak CppClass object inside handleLookupItemMatch()
when the task was canceled.
Amends: c400923308
Change-Id: I709e14a0c8b563d522a8e8c32b087e5f83310b24
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
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>
Don't freeze UI on request for show Type Hierarchy.
Move the lookup code into a separate thread.
Don't clear tree hierarchy when waiting for new one.
Show progress indicator on top of old hierarchy instead.
Add a task to ProgressManager when working on a new hierarchy.
Handle canceling the process of showing Type Hierarchy.
Implement simple progress reporting for this process.
Optimize a bit DerivedHierarchyVisitor.
Change-Id: I3894ac6ed3f4834831831f083f718f8385ca346f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
std::mismach() overload taking 3 arg assumes, that
second string is at least as long as the first one.
We don't guarantee this, as somethimes filePath2 is
empty string. Use 4 arg overload instead, which
ensure we don't exceed the valid range.
Fixes: QTCREATORBUG-24970
Change-Id: I8b7b11d124f69c7c9cb3246ee969f134fa026e08
Reviewed-by: hjk <hjk@qt.io>
This basically extends the existing hack to cover one more case. It may
very well break again in some other context, in which case we will
remove the custom definitions entirely, as the reason they exist in the
first place does not seem terribly relevant.
Fixes: QTCREATORBUG-24580
Change-Id: I757ac23682c81c647a5d968fa549baac5716010c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Courtesy of readability-static-accessed-through-instance
Amends: b2a766a79a
Round #2: This time done with Qt Creator's Analyzer, which
found other occurences than run-clang-tidy.py
Change-Id: I479e280c7abcf2d24baccbb0af69ae4bda05198e
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>