The ClangTools plugin tests open a project and immediately trigger a
build afterwards. We checked whether CppModelManager got already data
from the project manager, but this alone was racy for the mentioned use
case as e.g. the QbsProjectManager might still be in parsing mode and
thus the build was not triggerable. Check for the parsing state, too.
While at it, simplify the code by using QTest::qWaitFor(), which also
takes care of posted events.
Change-Id: Id298695b2e67578def42275bac4ea31f4a39edf2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This does not cover Utils::MapReduceOption with QVector, and code
that's not compiled on my machine.
Change-Id: Ib63923985c52b1bb74e5ec2068a2bb37469ac618
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
We should not force the tool tip text to HTML when help content is
available or when adding the F1 icon.
Instead add help content and F1 icon into the tool tip layout.
Change-Id: Ibe2d4fa2fb81bcda4e5aeb0d7d86dbf63fcf3ce6
Reviewed-by: David Schulz <david.schulz@qt.io>
If you build Qt Creator with CMake version 3.16, you will have
precompile headers which will break code model.
Change-Id: I679936faed39ecfedb9ebb5fb553449a9f5ea29d
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
We always set the target explicitly (in a certain way), so exclude the
target arguments coming from the build system and the (possibly manually
specified) platform codegen flags of the toolchain.
Change-Id: I74bbec67f5960f05b50cf9c5aa11875c71a5161f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Leave the function addExtraCodeModelFlags() around as it's used by
ClangPchManager::ProjectUpdater::toolChainArguments().
This allows us to filter out excess target arguments in a follow-up
change.
Change-Id: I742d713dd1ca6c391ba77c52555dcf4e94cc2ff9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
...also on Linux.
That's what clang invoked from the command line does.
Change-Id: I59c48d11fab3b944bb42ca7bb4cd9093a735df60
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
...by removing pointless backslashes.
'/' is not meta character, therefore escaping it with a backslash is not
needed.
Change-Id: Ic0bd1f85b3eed721cad67f4b4d616352ea9e098a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Given the (default) include paths of GCC, e.g.
/usr/include/c++/7
/usr/include/x86_64-linux-gnu/c++/7
/usr/include/c++/7/backward
/usr/lib/gcc/x86_64-linux-gnu/7/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed
/usr/include/x86_64-linux-gnu
/usr/include
discard gcc-internal paths like /usr/lib/gcc/x86_64-linux-gnu/7/include
as they are not relevant for clang and even confuse it with regard to
#include_next.
Paths below the gcc install dir are considered as gcc-internal. The
install dir is queried with
$ gcc -print-search-dirs
Some GCC distributions, like MinGW, ship the standard library headers in
the install dir. Ensure to not discard these.
Fixes: QTCREATORBUG-22898
Change-Id: Ia85258fb01b72ad073e71390e003fe8268e3b01f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Unknown command line options starting with / are now transformed
into commands starting with -, which will cause unknown commands
warnings in libclang.
The / commands cause errors because they are treated as missing
files.
Fixes: QTCREATORBUG-22871
Change-Id: I75f7878ab6a7951df24c954ccff1c298ea65f839
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Add a separate pool of custom diagnostic configs for the
ClangTools plugin. That is, the diagnostic configs in
Menu: Tools > C++ > Code Model
are not shared anymore with the configs at
Menu: Tools > Analyzer > ClangTools
On plugin initialization of ClangTools, move tidy/clazy related configs
to ClangTools.
Change-Id: Id06087a58b53e466a3d7bbac669550c5fbe9899d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Clang cannot handle gcc pch files which are close to the forced
include header.
Fixes: QTCREATORBUG-22888
Change-Id: I0d678a889d1fb62bf3c6850277e13271efb91eea
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Especially in the light of the language server, the generic project is
currently the project one can use for language servers that require a
"project workspace".
Makes it possibly to run Qt Creator with
"-noload CppTools" if you still want to use generic
projects with some other language.
Change-Id: Ib9059289a2db4c44c0c1060a02fcdafacb885fbd
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
It was only left for the C++ category for the Qt class generation
settings.
Change-Id: I22d3f198f7b825c4a36d08d4ee28091b9e5b1f43
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Used for updating project parts, so move it near RawProjectPart.
Change-Id: I77aeffbdbfb3d2ec0de600f61dcf7fbb7a355a98
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Doesn't have any dependencies into CppTools anymore, therefore moving it
reduces the dependencies of the project managers to CppTools as well.
Change-Id: Ibe728abe59eb88a8877943dca1f48a85163e27ac
Reviewed-by: hjk <hjk@qt.io>
In the new plugin setup scheme they are data members of the
plugin pimpl and never use the parent.
Change-Id: I28fe150393e8159064dcfbd113ce0320af50fd58
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Given the following example:
typedef int value;
void value_test(void) {}
void test(value v) {}
searching for "value" findes both candidates; and
for the locator filters "m" and "." highlighting
already worked fine.
For the locator filter ":", however, the arguments
are displayed in the extraInfo column. To get proper
highlighting here, we have to repeat the regexp match
in this column.
While fixing that, make sure that full-qualified
searches (separated by "::") are still highlighted
properly.
For the Clang Code Model, there is still a bug not
addressed by this patch:
Ctrl+K with ". value" -> "value" isn't highlighted yellow.
Change-Id: Idd5eeeedb893151cd5c7f70f6b11397db788b706
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
QtVersion to utils/cpplanguage_details.h which already contains similar
flags.
BuildTargetType to ProjectExplorer, next to BuildTargetInfo (but not in the
same header to not pull that in everywhere).
Removes dependency on ProjectPart from RawProjectPart.
Change-Id: I5791065e4266f20c2657ee4b1b594df04b238a1c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
The feature to category files to ProjectFiles was used by the qmake
project manager to specify if the file is "active", and by the Qbs
project manager to avoid unnecessary MIME type checking.
Make these two different use-cases explicit in the API.
Change-Id: Ia5a7da37f100149366fc75060fe04687e15f2bd3
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Instead of open a document for every entry we do open it only once per
search. For that we sort the entries by file path, so that they are clustered
together and reuse the last document if the path hasn't changed. This can
improve the calculations of the search results drastically.
Change-Id: I9c9c1e387624297d84c6a2ca6edb6130f739d295
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Otherwise the doxygen generation will not work.
Fixes: QTCREATORBUG-12411
Change-Id: I3e887dfeb5caba727da6e56a056c092c5a2e23f9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
It is unlikely that a user will want to look at generated files --
and if she wants to, there is always file search.
Task-number: QTCREATORBUG-20176
Change-Id: Iefb0aece1dbd6b39aa8892388411c10162319102
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
... that already used index-based prioritising.
There are a few more with two- or three-level priority,
but these still use the old scheme with multiple lists
good/better/bestEntries and converting them would not
gain much.
Change-Id: I21f7cfe07a3ae8183db9cb62311697d03db6e4da
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
The VcsBaseSubmitEditor uses CppModelManager to collect the symbol names
from the affected files for completion in the commit message.
Move the C++ code model code into CppModelManager, register it in the
plugin manager, and call it via QObject means from the submit editor.
This avoids a hard dependency from VcsBase to CppTools.
Change-Id: I2fb34dbef153c1414820d711e7fc5596bcac1691
Reviewed-by: hjk <hjk@qt.io>
The reasoning in 1b4766e26c did not take into account that the scope
of QT_NO_JAVA_STYLE_ITERATORS may change over time, as done with
f70905448f6 in Qt base.
Change-Id: Ib1966ff26c4d36d5f62e149d6b45baa4aecf825d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Recently tons of warnings show up for presumably "problematic"
singned <-> unsigned and size conversions.
The Qt side uses 'int', and that's the biggest 'integration surface'
for us, so instead of establishing some internal boundary between
signed and unsigned areas, push that boundary out of creator core code,
and use 'int' everywhere.
Because it reduces friction further, also do it in libcplusplus.
Change-Id: I84f3b79852c8029713e7ea6f133ffb9ef7030a70
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Never overridden, and does not look safe to invoke more than once.
Change-Id: If5f3830f3fbf26badb6335443defd628c05cf65a
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: David Schulz <david.schulz@qt.io>
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.
Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Fix that the invocations
CppLocatorData::onDocumentUpdated(Document{"bla.cpp", revision=5}),
CppLocatorData::onDocumentUpdated(Document{"bla.cpp", revision=3}),
would add two entries in m_pendingDocuments. The document from the
latter invocation should be ignored due to its outdated revision.
Change-Id: I5e9eb4de77f59633d5525d808bd60ca1259f894d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
... from the environment.
Fixes: QTCREATORBUG-17985
Change-Id: I9b54e550121cfcc0684a6e173337d59d235c6107
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
C++14 supports the use of single quotes inserted between integer digits
as a separator. Updates the built-in C++ code model to recognize such
quotes. This fixes highlighting and indentation issues.
Change-Id: Ic35ce93060b96700a11d108dce1f3cf6c4543632
Fixes: QTCREATORBUG-14939
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
generateClangTidyChecks.py generated funny output as it was not
considering new major categories.
Fixes: QTCREATORBUG-22450
Change-Id: Ibd6d0cc7539c9fb846caacbe936770d0c960f04f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
... to the bits that are actually used.
Change-Id: I39a6ed1f4136d75b776bb89eec6165479097a4ec
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>