Commit Graph

11 Commits

Author SHA1 Message Date
Christian Kandeler
019af2cc9a C++ unit test: Adapt to clang 11
Change-Id: I3ea6278147577899ea97032e17f0cd257423586c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-09-23 09:13:47 +00:00
Christian Kandeler
15a1266d50 clangbackend: Do not handle built-in types specially
... when collecing tooltips. The more general functions provide more
information, such as constness.

Fixes: QTCREATORBUG-14950
Change-Id: I6d0a890a695e19e9754b5538ba092a188a3bbbb0
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-07-06 06:32:33 +00:00
Christian Kandeler
949bb0e67b ClangCodeModel: Show value in tool tips, if possible
When hovering over a constant expression, it's probably helpful
to show that value to the user.
Requires clang 11 to fully work. For now, it only shows the value for
variable initializations.

Fixes: QTCREATORBUG-23967
Change-Id: I6b844231bac50993c2fa2fa82c552ad9cef590df
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2020-05-26 08:50:58 +00:00
Ivan Donchevskii
53c407bc0c Clang: Fix build with clang-8
Clang-Tidy checks and Clazy flags updated.
CLANG-UPGRADE-CHECK done.

Change-Id: I1ca585c5c3c77a7f183719df9c262603150914e8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-04-17 12:13:36 +00:00
Nikolai Kosjar
6889f4df80 Clang: Fix tooltip for pointer to class
Detect and dereference pointer to get to the correct class.

Fixes: QTCREATORBUG-21523
Change-Id: I679778b2cfbbce4466294dabdee096686f53f095
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-12-06 08:55:28 +00:00
Nikolai Kosjar
d52ac9a708 Clang: Fix unresolved #includes for ui_*.h headers
...with an extra parse.

Previously, the creation of an e.g. "Qt Widgets Application" from the
wizard could show code model errors in mainwindow.cpp. Depending on
timing issues, the first error is either

  1. 'ui_mainwindow.h' file not found (QTCREATORBUG-15187)
    The parse happened before the in-memory ui_mainwindow.h was
    generated by uic. The file system watcher can't help here as the
    #include was not resolved successfully. And libclang's reparse does
    not handle this case (it would need to remember all failed #include
    stats...).
    ==> Detect this case with the help of the include paths and trigger
    a full parse.

  2. or: allocation of incomplete type... (QTCREATORBUG-15187)
    The parse happened after the generation of the in-memory
    ui_mainwindow.h, but before the clangbackend received the unsaved
    file.
    ==> Fix this by also writing the content of the unsaved file to our
    behind-the-scenes-created ui_mainwindow.h.

Fixes: QTCREATORBUG-15187
Fixes: QTCREATORBUG-17002
Change-Id: I4f3a81adaa3d604746977a402c29f83fbc5b0e44
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-10-31 10:38:27 +00:00
Nikolai Kosjar
aa290912b8 Clang: Remove project tracking on clangbackend side
...as it is not needed. Just provide the compilation arguments as part
of the Document.

As a side effect, re-initializing the backend after a crash is cheaper
and will not freeze the UI anymore (referenced bug).

Task-number: QTCREATORBUG-21097
Change-Id: I866e25ef1fd5e4d318df16612a7564469e6baa11
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-09-26 10:45:41 +00:00
hjk
cf4dbb4bb6 ClangSupport: Use simpler structures in some cases
The patch is mostly mechanical, but contains also a few spurious changes
from values references for some local variables, foreach -> ranged for
etc that I coulnd't resist.

Change-Id: I58f0bd972546895eb318607cbfbd7ac35caf3f23
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-06 12:55:23 +00:00
Nikolai Kosjar
608e7ec245 Clang: Fix tooltips for constructors
Constructors were not handled yet, so the tooltip for e.g. the
"QString()" constructor was "void ()".

Also, since the help system has problems with overloads, show the
function signature as clang sees it and provide a help system query that
will show the documentation for the class instead of the wrong overload.

Change-Id: Idc0cf9dce6a50c323e6fd945f277c7816b0f9b34
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-22 12:33:21 +00:00
Nikolai Kosjar
fdc88939d6 Clang: Fix ToolTipInfo.IncludeDirective test on Windows
Change-Id: I8a6d7c6d46474db4455cb9e2bc90e2e7e527e474
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-01-17 14:38:31 +00:00
Nikolai Kosjar
76c25bcd6a Clang: Provide tooltips
This includes also the query data for the help system (F1) for an
identifier under cursor.

Regressions (libclang changes necessary):
 - Function signatures do not contain default values.
 - Aliases are not resolved for/at:
   - template types
   - qualified name of a type

Fixes/Improvements:
 - Resolve "auto"
 - On a template type, show also the template parameter.
 - For a typedef like
     typedef long long superlong;
   the tooltip was "long long superlong", which was confusing.
   Now, "long long" is shown.

New:
 - Show first or \brief paragraph of a documentation comment.
 - Show size of a class at definition.
 - Show size of a field member in class definition.

Task-number: QTCREATORBUG-11259
Change-Id: Ie1a07930d0e882015d07dc43e35bb81a685cdeb8
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-01-16 15:32:15 +00:00