Feeding libclang with unsaved files (e.g. in-memory generated ui_*.h)
that do not exist on disk leads to regeneration of the preamble on every
parse/reparse/completion and thus renders the clang code model useless.
We could check the existence in the file system for every unsaved file
just before every parse/reparse/completion. Obviously this does not
scale (e.g. qtcreator.pro generates about 200 unsaves files) and would
also slow down the responsiveness of the completion, especially for the
dot-to-arrow correction case.
We could also set up a file system watcher. However, implementing the
"file got created" case is not trivial because QFileSystemWatcher does
not support it out of the box.
Instead, set up a custom include directory and create empty files in it
that represent the unsaved files and pass that include directory to
libclang as the last one. While this fixes the performance problems, it
also comes with at least two problems:
* Because ui_*.h files are "relocated" to the same directory, two or
more "foo.ui" in the same session will be problematic.
* Because of the custom include directory, problems might arise for
projects that include the ui_*.h as "some/relative/path/ui_foo.h"
instead of "ui_foo.h". This should be the less common case.
Task-number: QTCREATORBUG-17245
Change-Id: I6e40e87c3ef095086eb22c972dd8c1a6459a8245
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
On project loading ExtraCompiler objects are created that might read the
already existing ui_*.h files in the build directory. In this case,
ExtraCompiler::setContent() is called, which will emit a signal about
the modified content.
Now GeneratedCodeModelSupport is a client of this signal and it forwards
the changed contents to the clang code model. However,
GeneratedCodeModelSupport objects might be created later and miss the
initial signal emission, thus leaving the code model unaware of some
unsaved files.
Fix by notifying the code model at construction time of
GeneratedCodeModelSupport.
Change-Id: I7311867ad7f534920357801647bd2d0c82bb4edb
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
nodeinstanceserver.cpp: In member function 'void
QmlDesigner::NodeInstanceServer::setupImports(const
QVector<QmlDesigner::AddImportContainer>&)':
nodeinstanceserver.cpp:458:71: error: conversion from 'const char*' to
'QChar' is ambiguous
Change-Id: Ifa4cb2700344aaacc17619f05249f338e9b28d0b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Not having a QtQuick import does not make much sense and
will lead to undefined behavior.
Change-Id: I1b103b088db1bedc191b9a3dbdeb1e45c87dab85
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This should improve the sitation for QTCREATORBUG-17306,
but will not fix it.
Change-Id: I28da773da4f4a4e438e959d44a924ea90b1e73fb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
The functionality tested is used in other tested places.
Change-Id: I62883e81dab9f26ac63e1f45f039571ca1f6a32e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Extend ABI by flavor and add look-up.
As with each major update, rewrite the the MSVC toolchain
autodetection.
Previously, the detection looped over the entries in "VC" registry
section and checked in the "VS" section whether a valid installation
belonged to the entry. MSVC2017 no longer has an entry in the "VC"
section.
Introduce a struct describing the installation including version
number and rewrite the loop to run over the "VS" section and retrieve
the VC path from the "VC" section only for versions <= 14.0.
Also, the various .bat files for the target architecture are
now in a single folder instead of spread around various bin/XXX
subfolders. Introduce an array of structs for the platform that
has the prefix and .bat name and uses the prefix only for
versions <= 14.0.
Task-number: QTBUG-57086
Change-Id: I947edd885c0a379f196440041c07d60cd4244d9c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
A truly empty base wouldn't need content, but LLDB 3.8 reports declared
but not defined undistinguishable from empty bases. At least for the
common case of a single inheritance class we can continue dumping by
fake base class contents by fake the contents by using the whole derived
object's data.
Change-Id: I82d595b985ec1289d8abce5fccd217057d2d2d44
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Returning a None type will result in a nicely formated traceback.
Returning Null will just result in an exception that has
to be debugged.
Change-Id: I09ff90923fe0fef25a96c3110156f706f73e8913
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Type names generated from module and type id are sometimes incorrect.
Change-Id: I4bbd4db029e7952703efe09f9beb92f703e400d9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
... by directly accessing the IDebugSymbolGroup.
Change-Id: I2d17b8cd3cec2de8192713415826fd982d693d84
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The images do not exist and scroll bar is not required
in the item library.
Task-number: QTCREATORBUG-17307
Change-Id: Id8f493fdcee97a611d38a8ba896af1d53ed340da
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Previously, the detection relied on the variable CPU which
is no longer set current versions of MSVC.
Use newly introduced variable VSCMD_ARG_TGT_ARCH (MSVC 2017) or
Platform (MSVC 2015) to detect 64bit.
Task-number: QTBUG-57086
Change-Id: Ie71b73a04af597d5b638fd08171ee9bfb3b4ccb8
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
qfinitestack_p.h is not self-contained, #include <stdlib.h>
manually to get access to malloc().
Change-Id: I628e5e2a872d361bb7b246ec7333efb3c94dae98
Reviewed-by: hjk <hjk@qt.io>