The fixits have own ranges/locations and thus might address more than
one file.
Change-Id: I5ee59944bef588e763a91f054a60823593373a0e
Reviewed-by: David Schulz <david.schulz@qt.io>
We never used the possibility to overload the virtual child() and
rowCount() functions, it's unlikely to be needed in future.
Change-Id: I7ebdf4dfc70bb0bcadea9ef3fb88f16632a95696
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
We get different mangled names on windows and unix. As we do not
actually use the mangled names and to reduce the maintenance for this
test accept any mangled name, as long as it is not empty.
Change-Id: Id154da430db6958eb40e5b409e5fb186778d41c1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
libclang 3.8 seems to be sensitive to file paths separators [1]. On Windows,
this led to not updated document annotations and/or crashes after reparsing.
When passing file paths to libclang, convert to native separators.
When getting file paths from libclang, convert back.
This handles:
* main file path
* file paths of the unsaved files
* -I<DIR> arguments, the resource path (for builtins) and the paths to the
wrapped qt headers
* included header files from libclang
* source locations from libclang
Also, minimize the conversion in SourceLocation to a minimum by making
filePath() lazy.
[1] https://llvm.org/bugs/show_bug.cgi?id=28381
Change-Id: If5866f34a6fdc6b34b16c022d3988e8e6eae2a0a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Qt Quick template does no more use a pri file.
Change-Id: I5418d1b945c8981218ddcbcf5423d6c623b377b6
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
We want to share more functionality of the IPC mechanism and for what we
need more interface classes. But we use this names already for the
ClangCodeModel implementation. So we rename the them to ClangCodeModel*.
Change-Id: Ie320e0d3b993586a9bcc6a5aa0d32427af41202e
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
File seems to be useless and is not used at all.
Change-Id: I7b6d7f8804cdf07c6027abb9822d99bdf5ad9dbf
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
...with MSVC2013.
tst_lexer.cpp(406) : error C2398: Element '1': conversion from
'CPlusPlus::Kind' to 'unsigned int' requires a narrowing conversion
Change-Id: I1c9415cb02d2f0fa85d48a1abbc688d8f53b5b43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
(cherry picked from commit 04b2194781)
...with MSVC2013.
tst_lexer.cpp(406) : error C2398: Element '1': conversion from
'CPlusPlus::Kind' to 'unsigned int' requires a narrowing conversion
Change-Id: I1c9415cb02d2f0fa85d48a1abbc688d8f53b5b43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
The issue was re-producible with e.g.:
void g()
{
// Type 'foo.' as fast as possible in the next line
}
This led to "foo->" with completion results as if there was no "foo." at
all in that line.
We relied on a correct position for
translationUnit.sourceLocationAtWithoutReparsing(), but the just typed
characters were not yet reparsed. And we do not want to reparse at that
point since takes too long. We already determine the utf8 position for
the dot character, so simply use that instead.
This completes commit 17c1325cc4.
Change-Id: I669888b5c17ee63b2aec7b16c9921f9d79e281f9
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Now the ref-qualifier (& or &&) of the function declaration
is propagated to GUI. For example, 'Refactor' -> 'Add Definition'
preserves the ref-qualifier.
Change-Id: I8ac4e1cad4e44985e94230aabbd9858a7e929fee
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
The current code always ends up setting the token to T_GREATER_GREATER.
Change-Id: If75ff1f5bccffd5918ec2bf491724cd0981220ae
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
The test data produces different results when it is run with libclang
3.6 and libclang 3.8. (lib)clang 3.8 will generate an error instead of a
warning and suppress further diagnostics. See below.
Use simpler test data that is agnostic to the different clang versions.
$ cat input.cpp
class X {
X(X&&) noexcept;
};
X::X(X&&) = default;
int function()
{
}
$ clang++-3.6 -fsyntax-only -std=c++11 input.cpp
input.cpp:5:4: warning: 'X' is missing exception specification 'noexcept'
X::X(X&&) = default;
^
noexcept
input.cpp:2:5: note: previous declaration is here
X(X&&) noexcept;
^
input.cpp:9:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
2 warnings generated.
$ clang++-3.8 -fsyntax-only -std=c++11 input.cpp
input.cpp:5:4: error: 'X' is missing exception specification 'noexcept'
X::X(X&&) = default;
^
noexcept
input.cpp:2:5: note: previous declaration is here
X(X&&) noexcept;
^
1 error generated.
Change-Id: I6d786a8b87eb4438fa8db36540db9358181b9a5b
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Added test cases and modified the test suite in order to make it
data-driven. Each sample file can now declare the number of
expected messages. If there is no declaration, zero is assumed.
Change-Id: Ife3daa10a258f51ea8f896156f6f6af783406b84
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
Covers the common case and hopefully avoids the recurring MSVC
problem with initializer lists in this location.
Change-Id: I1b2bbb083f9fc86af3b51b8f52615fb70c832b95
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This splits out the case of static string displays from the
TreeItem base class, making the base more lightweight.
Change-Id: If1f442011ec60094399a41b65d9b5015f432f82e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This test is covering the standard issues we had with the
code model regarding QtQuick Controls (2).
We check if ApplicationWindow is derived from QtQuick.Window
and if Button is derived from QtQuick.Item.
Change-Id: I1a2ed894daeb06743fb950bf629a8dcf2b9a78e6
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Marco Benelli <marco.benelli@qt.io>