Reproducable with
1. $ ./qtcreator a.cpp b.cpp
2. Switch to a.cpp => no highlighting
Because ClangEditorDocumentProcessor does asynchronous processing, the
backend might receive a DocumentsOpenedMessage where the document is not
the current editor (happens for a.cpp in the example). When switching to
that document, the initial jobs were not processed as the document was
not dirty.
Address this case by also checking for documents that have a revision of
1 and are not dirty. Unify adding the annotations jobs to ensure that
not more than needed are run.
Change-Id: I14030260842f97d58280235e763c8d7490705f8d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This completes
commit f01fbcb789
Clang: Clean up some IPC names
Change-Id: Ic747ca4a01e5c693bd59626eef516ae4a42bf9fc
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
With recent clang versions we can show default arguments properly.
Change-Id: I6028db183b0413650a32928d0051afb9402c5e32
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
A general option for disabling library linking generally for all
projects.
Task-number: QTCREATORBUG-20240
Change-Id: I9f7f53e6deae7079613be32dadcd1325e5579720
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Do not show the same operator twice in symbol outline and
current document filter.
Extract common checks to TokenInfoContainer class.
Change-Id: I3b48aa949d678564c952a71f650b7ba601570fa2
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Treat everything inside function scope the same way
as local variables.
Change-Id: I038d84e5e90057d65a08afc742ebcdf2de55ff85
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
If you are retrying, then probably you want it to be more patient this
time. Also, tell the user how long we have waited and how long we are
going to wait when retrying.
In turn, reduce the number of "internal" retries. Retrying 10 times
should be enough to determine if the given timeout is too short. This
will give us an initial waiting time of 2s, and make the second try 4s.
Change-Id: Ibdfe02d041550eb16cadc59cec1b78ce97289b30
Task-number: QTCREATORBUG-20529
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
... in the Projects view in the sidebar. Also, there is a big
Manage Kits button in the view now.
Change-Id: I3440fa34b98dba4c71a1c6a6559af31f7d9fd78c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
The actual remaining use was to pop up a terminal in some
setups where Mode == Console, with a default of Gui meaning
"no console". In some downstream uses it was used set to
Console (probably to mean "this helper process does not need
a gui") but then luckily ignored when actually starting the
helper processes.
All cases where the console is useful and requested are
nowadays RunWorkers belonging to RunConfigurations with
a TerminalAspect, so they can directly get the relevant bit
from their RunConfiguration without having it part of
all StandardRunnables.
Change-Id: I1368d5968da5cf672656aebf200ccac8d45335d0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Testable on Linux/macOS by changing c++14 to c++1z in qtcreator.pri.
Testable with latest MSVC2017 by setting _CL_=/std:c++17.
unary_function, binary_function, and a few other things that were
deprecated are removed in C++17.
std::string got a non-const overload for its "data" member function,
so we cannot create a function pointer on it without specifying its
type. Use std::declval instead (though it requires a default constructor
for the type).
MSVC seems to have an issue with Utils::transform for std::vector
(used in Nim plugin), but that looks like a compiler issue.
Change-Id: I94f9a93d591d55b610f86fabfc618158927d6221
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
When the path listed in a PathChooser does not exist,
instead of showing actions on non-existent paths show
"Create Folder".
Task-number: QTCREATORBUG-20532
Change-Id: I98d149129ad33d7be36bfe13b2c1ab57ee193cf0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
...when a new run is triggered instead of on Qt Creator shutdown.
There is no reason to keep them around for longer than needed.
Change-Id: Ida7698843cc2f8822ffd662679cf5da2c4ece05c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
... in the Projects and File System views in the sidebar.
Change-Id: I38c77d8e5c19a1adb934c5b8d4777889467392c6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Passing an empty string to File::exists() results in a
warning coming from inside Qt.
Change-Id: Ia115c53cc748c3ad446544a8ac85f9951182f50c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
The warnings from ClangCodeModel confuse our build check.
Change-Id: Ic6b82bb304387f447bdf8eb0b2fd02dd2f250fb2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Passing an empty string to QFile::exists() results in
'Empty filename passed to function' to be printed on the
commandline.
Change-Id: I028f0ec18447642b30be1a51f4c70b6ae18d45b1
Reviewed-by: hjk <hjk@qt.io>
Serialized diagnostics consume quite a lot of space.
Remove these files after they are read by QtC.
Change-Id: I4b257e44ee182484726ebd808069198443992016
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
...because
1. We already run in a separate process.
2. It's not entirely clear in which state we end up after a crash,
except for:
3. A "crashed" translation unit won't be freed, even when calling
clang_disposeTranslationUnit().
This avoids undefined behavior within clangbackend and accumulated
leaking memory in the long run. On the other side, crashes within
libclang will crash clangbackend now, too.
Change-Id: I0789c52db08ace2f7e181e3b7bdfc9f595f75e8d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
We already run all operations in threads to avoid blocking, there is no
need to start more threads within libclang. Before this change, a
reparse would trigger 3 threads to start:
1. clangbackend: Utils::runAsync() for the job
2. libclang-internal: thread for reparse
3. libclang-internal: thread for annotating tokens (highlighting)
Ensure that we use the same stack size for our threads as libclang was
doing internally. C++ parsers usually have higher stack size
requirements.
Change-Id: I2f67602ddfbf77ea2c69144b56acf64ba08041f6
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Make the preview of variable "FOO" work in the variable chooser when the
macroexpander also has a prefix "FOO:" defined.
The MacroExpander::isPrefixVariable method is broken in this case: It will
append ':' to the variable name if it is not there already and will thus
return true for both "FOO" and "FOO:". So avoid calling it.
In this case this does not even lead to more look-ups: As the variable chooser
uses the description of the variable as a key, it contains "FOO:<value>" for
the variable name and uses that checks whether "FOO:<value>:" is a prefix variable
or not. That is always false.
Task-number: QTCREATORBUG-20504
Change-Id: I3ea83a4df6d72aac157fa6777106966cc9e9976d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
...with runAsync().
The stack size cannot be changed after starting a thread, so specifying
the stack size with a pool does not make sense. However, starting
with Qt 5.10 a stack size can be specified for the whole thread pool, if
needed.
Change-Id: I09eded606321388c779f762b77de6223081609fe
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This is long overdue since some names were simply wrong and/or
misleading. Also, some of the old names were long enough to almost get
crazy.
The renaming starts from ClangCodeModelServerInterface and
ClangCodeModelClientInterface and affects usages and related functions.
For the ClangCodeModelServerInterface, categorize the messages in
- messages that require a response (request*)
- notification messages (the remaining ones)
Change-Id: I5342ed8e0d87404ee72f3c3766fd8ef7505defb1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
When built-in code model fails to follow symbol under cursor
fall back to the clang result even if it only follows
to the decalration.
Change-Id: I22d8c5fee6ab7594b1d1b7ce8104414db28383c7
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>