The getClangResourceDirAndVersion() function in ClangTools could return
the actual resource dir or the include dir, depending on the input. This
mistake happened because of misleading names spread all around the code.
Now the function returns what it says, and the other names are accurate
as well.
Change-Id: I0a8600857ee7b9fafb16256e0d1ad203ac3273d2
Reviewed-by: David Schulz <david.schulz@qt.io>
That is, also do function-specific magic on typing "/**<return>" in front
of a function if there is an access specifier such as "public:" in
between.
This use case is rather weird, but it's also pretty easy to support and
it should not hurt anyone.
Note that depending on the indentation of the access specifier, the
indentation of the inserted comment will probably not be what the user
expects, but this is not easily fixable.
Fixes: QTCREATORBUG-20311
Change-Id: Ie32a71eede91ef64a19381c8e379a183a91fd27d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Multi-line strings must be kept as the user wrote them.
Fixes: QTCREATORBUG-20180
Change-Id: I141eff52b55d31215e6f5c6c5a0e026689db877a
Reviewed-by: David Schulz <david.schulz@qt.io>
There were annoying inconsistencies, for instance:
- A not fully matching declaration was found from the definition,
but not vice versa.
- An implementation MyClass::foo(int) would fall back to a
declaration foo(), but an implementation MyClass::foo() would
not fall back to a declaration foo(int).
These cases behave consistently now. To this end, the clang code model
now forwards to the built-in code model if a function lookup has failed.
Fuzzy matching for free functions has been limited, as the cons appear
to outweigh the pros. For instance:
void foo(int);
void foo(double) {}
Following the definition would lead to the non-matching declaration,
which the user most likely does not want.
As a side effect, redundant code has been removed in the SymbolFinder
class.
Fixes: QTCREATORBUG-20279
Change-Id: Ib97d6710c7e12fb0fdbc30b51a0067e09bfc2190
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
... and support it in the ClangCodeModel.
This allows users to get function signature(s) displayed regardless of
where exactly the cursor is on the function call.
Fixes: QTCREATORBUG-19394
Change-Id: I033e8774db93680bfc3ee52610b817e0ef8ccc76
Reviewed-by: David Schulz <david.schulz@qt.io>
QT_USE_FAST_CONCATENATION doesn't do anything nowadays.
Using QT_USE_QSTRINGBUILDER is the same as QT_USE_FAST_OPERATOR_PLUS
for QStrings and enables more QStringBuilder use for QByteArrays.
Change-Id: Ibd297817c50d86661d47822799f989447249af1b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Use case-sensitive sorting in the side bar outline, just like in
the editor outline.
Fixes: QTCREATORBUG-12714
Change-Id: I9d8243c61fcceb6e3d7b55e3b27fa5d20accccea
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
After the arrow, the state is still the same, as now a type is expected.
Only after the opening brace does the actual function start.
Fixes: QTCREATORBUG-18497
Change-Id: I7bf18fbd6907d36f8869af3a78ad617cf0ee9dbb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
If you create a ClangFormatIndenter but do not set the
fileName, the indenter will SegFault while indenting.
Change-Id: I93a56d7916bc1a02da9ee21a116bd48b4405edb1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Clearly, if a user presses F2 on the declaration of an (unimplemented)
pure virtual function, they want to go to an implementation in a derived
class.
Fixes: QTCREATORBUG-10160
Change-Id: Ie8c4ff0001ab2c98a2d0e2ebc8d954cc928578c0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
That is, offer existing namespaces for the class name line edit and
existing classes for the base class line edit.
Fixes: QTCREATORBUG-10066
Change-Id: I276036864626eff92997e40e4e22ab16c4f4d617
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
We did not notice because the JS array was auto-converted into a string.
Amends bcc2b5e08d.
Change-Id: I06ee43f78cb3081bdff0a02f8d446326a01bc2d1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This now requires license templates file to be Unicode compatible,
effectively restricting it to plain ASCII in non-Unicode codebases.
Task-number: QTCREATORBUG-24098
Change-Id: I713fed1ddb288360abbdbb40c6ca67444eb62ef3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
So if you use the ClangFormat Plugin, the ClangFormatIndenter is used
and not the CppQtStyleIndenter.
Change-Id: I7e71867cd4b48525ddc2f9b2dce8f13a65c3ad88
Reviewed-by: David Schulz <david.schulz@qt.io>
Prevent mingw from trying to #include_next a private header from a path
we cannot add to our list of includes.
Fixes: QTCREATORBUG-24251
Task-number: QTCREATORBUG-24027
Change-Id: I18a9db130b9c2265cd208c3506d08d2e1c4cee45
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
The coreplugin/id.h header is kept for downstream for now.
Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
(cherry picked from commit 430a33dcd9)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
... not just functions.
This includes global variables and static members.
Fixes: QTCREATORBUG-18828
Change-Id: Iee9f83a4f955a859c6fc4038c61997b30afdaec8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The ClangTools and the AutoTest plugins use an internal
mechanism to load and configure a project when performing
their integrated unit tests.
Both assumed to have exactly one kit present for these
tests.
Make it possible to have more kits present when starting
with existing settings or if more kits get automatically
generated when starting with clean settings.
Change-Id: If2bc66320c4854f1d34a19d17107e8f0b7d64d39
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>
As ClangDiagnosticConfig() has tidy and clazy enabled by default now,
the ClangTools' importDiagnosticConfigsFromCodeModel() takes diagnostic
configs on start up away from CppCodeModelSettings.
Ensure that built-in configs do not have tidy/clazy enabled by default.
Also, when importing, look at the actually enabled checks.
Fixes: QTCREATORBUG-23717
Change-Id: Id8370ae2fff2392fc94aa957fd33c1954aff5594
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
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>
... when using a shift operator inside an initializer list.
Fixes: QTCREATORBUG-16977
Change-Id: I8992162c05345b713c665e3601ae593af5007211
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Allows adding arbitrary widgets in front of the replace button
Change-Id: I0a9a16ca1e06c217639f458dd7946db8a43f98b1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
If pre 4.11 settings are present, this might lead to updated settings
being written at startup.
The code that writes settings indirectly uses the CppToolsPluginPrivate
instance via the "d" member of CppToolsPlugin. So this code path crashes
if triggered in the constructor of CppToolsPluginPrivate, since at that
point "d" cannot be assigned yet. Separate construction and
initialization to avoid this.
Fixes: QTCREATORBUG-23916
Change-Id: I0cb8a08bd9aa051679b71b06f569c44d2faab5a8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Otherwise the doxygen generation will not work.
Change-Id: I07889d84c179ec0ad931d9790f9270ebbd6d259d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Keep the old method for now to ease downstream porting.
The change is kept mechanical, there's a lot of cleanup possible now
on the user code side.
Change-Id: I936baedd45b7ba057f1c789a1bec896886f48eff
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>