Test that local, argument and member variables are highlighted
correctly when referenced inside a lambda
struct LambdaTester
{
int member = 0;
void func() {
const int var = 42, var2 = 84;
auto lambda = [var, this](int input) {
return var + input + member; // All variables here
};
lambda(var2);
}
};
Change-Id: I3b7b86c57a91f0f254715770dd870033be928b28
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
We already had this workarounded, but it got lost in the refactorings.
Task-number: QTCREATORBUG-12067
Change-Id: Ie01f9d41f25d17d1b595204748634bc87ef44378
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
There is implicit knowledge that the reference is read only in the code
so we should honor that and make is explicit.
Change-Id: I0d6eab6595ae1414ad2607760a2e02fd49bafd72
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
void func() {
const int var = 42;
auto lambda = [var](int input) { // var is not highlighted
return var + input;
};
}
Change-Id: I95a5732ab8391e1232894e419b081c729e2d1ba1
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Sometimes you need a very small array which has a size and max size.
QVarLengthArray is simular but has some size and run time overhead and it
has no max size. It will instead malloc. So this array is for very small
collections under 256 values which never allocate and have only a size
overhead of a byte.
Change-Id: Ia392c750d566c4accc6077c3dc4d9d4ae501e599
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Perf is not producing reliable stack traces without.
Change-Id: I5f594d45b06a66d91b0c687937dd948d6c724c62
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
SmallString is a very simple utf8 string class. It's purpose is performance.
It uses a short string opimization which provides 31 bytes of heap free
memory to save a 30 bytes long string plus null terminator. If the string
gets larger heap is allocated. The grow strategy is 1.5 to improve reuse
of allocated memory.
It uses optionally constexpr to provide string literals.
Change-Id: I7757fb51abfeca200d074cbfce2f1d99edc0ecb0
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
...by introducing a custom tooltip widget for diagnostics.
Locations and fixits of child diagnostics are presented as clickable
links, leading to that position in the editor or to the execution of
that fix it.
Change-Id: I83e801e22d0421dd29275e333e5dd91587885cf1
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
We used to call QTextCharFormat::setToolTip from the ExtraSelection to
install the diagnostic tooltip. Since this allows to set only text
tooltips and we would like to introduce a custom tooltip widget for
diagnostics, make use of CppHoverHandler, which is more flexible.
Change-Id: Ia1b2c3c50810596ce4a3a025002e6e4efd8789db
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
QVariant has unwanted dependencies so we provided our own simpler solution.
We want to support move only types and calling the copy constructor as you
move the value in and outside. This copying is adding unwanted overhead
too.
Change-Id: I2e27a7924868efe81e8b8ff3415499c9fa22c2bc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
...by explicitly checking for the dot in the source.
Task-number: QTCREATORBUG-15654
Change-Id: I4172e88a7fbb3015ef391daf13ded1f0002aab9c
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This simplifies UnsavedFiles and makes TemporaryModifiedUnsavedFiles
useless.
Change-Id: I1896f971215ed22ce7aa7bf21b16381862b7469d
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
The extra "::" is showed in the tooltip right to the completion list
item, but it was not inserted.
Change-Id: I0ad2b816c56b8e3b5ccf0643f2c1a4f2a20b8818
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
E.g. "dynamic_cast<>()" showed up as item.
Let CompletionChunksToTextConverter default to plain text format and
explicitly request HTML where needed.
Change-Id: Iebce85cb888a5bd697ffdce364118b6dc65a435d
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
1 struct Foo { int member; };
2 void f(Foo *foo)
3 {
4 foo.<REQUEST COMPLETION> // correct '.' to '->' and provide results
5 }
The preferred approach would be to check if "foo" in line 4 is of
pointer type, but there is no suitable cursor (only CompoundStmt) at
that position since the code is usually not yet parsed and thus invalid.
Thus, just run the completion as is. If there are not any results for a
dot completion, re-run the completion with "." exchanged by "->". This
approach is inherently slower than the preferred approach implemented in
the built-in code model.
The following rare cases are not handled:
1) Requesting completion after white space:
Works: foo.<COMPLETE HERE>
Fails: foo. <COMPLETE HERE>
2) Opening a file and requesting completion (ctrl+space) without prior
editing. No editing before triggering completion means that no
unsaved file is generated on the backend side, which is a
requirement for the correction.
Task-number: QTCREATORBUG-11581
Change-Id: I6bc8e8594778774ab342755fdb01a8a3e5c52ba0
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
The source files are in /usr/src/g{test,mock}, the includes in /usr/include
They were also swapped.
Change-Id: I2a9ad84f8d29a0873a4e568f4b21a198c70d948c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
...in the function call completion tooltip.
Task-number: QTCREATORBUG-15286
Change-Id: Ie24576f98ee4ba8f954de394f3596093323a2c35
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
using NameSpace::StructInNameSpace;
Task-number: QTCREATORBUG-15271
Change-Id: I17a3ad1e1eed7a820ed7dead5d15a3de760c135f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
It looks like there is no way to mark a test as expected to fail, so
disable it.
Task-number: QTCREATORBUG-15473
Change-Id: Ic6cb2c00a64cf647cb499492064d451d0dd08075
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
Avoid the sub vector for performance reason and use an flag for every
optional argument because there can be no recursion.
Change-Id: Iae1eaa1f164e4129e30358a1719582e5231f0385
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
Offsets can be get wrong because of the utf8 <-> utf16 differences. Line
and columns are not that sensitive to it.
Change-Id: I2e3e8c000621b6d694a4ada6df176f29427794f5
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
So no reparsing is happen for invisible files.
Change-Id: I8bf3fe8aed38b30ceeabc50ba2f216acc4b8b718
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
"Editor Updates" are not to the point since what we generate is for the
document.
Change-Id: I94ceeca5c85c7cf01cc659ca55320d07010c8617
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
...for consistency and to avoid future file name clashes.
Change-Id: If595c8debfa1ceb01a1bb0ed34649fa513660503
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
...so that we can compile the tests without environment variables:
qmake LLVM_INSTALL_DIR=/the/path1 GOOGLETEST_DIR=/the/path2
Change-Id: I40633988d325720397dea28bd13b957a31712a9d
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
We send first the current editor, next the visible editors and the end
everything else.
Change-Id: I4a7b5924ffe563d6a74251739ddedcd005ce046c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>