We don't need the threading anymore, so we removed it. The indexer
will be run in its thread anyway, so an extra thread makes the code
only more complicated. And we added namespaces.
Change-Id: Ibcba306324763285cf653c28bb08122345e5f8da
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
f(x.get()); -> x.get() should be shown as a output argument
Task-number: QTCREATORBUG-18591
Change-Id: I99f5637660bcd0a889338ebfa6737d79de226f87
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
If you hover a diagnostics in for a clang query you get now a simple tool
tip.
Change-Id: I6352dd3d4b9a33c183e69037eac903469b90eea4
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Non constant pointers are used many times as non output arguments, so you
get misleading information.
Task-number: QTCREATORBUG-18591
Change-Id: Ic5f987db44ad63a0b1a38fd59cd807db5f2acc8f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Do not insert for these cases:
* <Cursor>{
* namespace X <Cursor>
* if the next block is indented, like e.g.:
if (e) <Cursor>
g();
* on empty line if text before looks like a finished statement or
scope opening/end
Change-Id: Id9decc1e964a775724a929c2a3e79b5283105560
Reviewed-by: David Schulz <david.schulz@qt.io>
We now support highlighting for an example text and for the query.
Change-Id: I88c415ff871cf3e4c2d4fc83d60a8555bf0ce08a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This is supposed to fix
[ FAILED ] ReferencesCollector.VariableInTemplate
[ FAILED ] ReferencesCollector.MemberInTemplate
on Windows.
Change-Id: I1a6486e524069c83da183e3e68df2dea8ba415ff
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Because we can visit headers many times, we get results many times too.
Change-Id: I3bbe7d7a5d01c2580a4569bfe115f14a69edc8a7
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Clang file ids are only unique for one query. Because we query in parallel
we have to manage our own unique ids.
Change-Id: I67d57d8b1766cab75ad252a14e57bbf9dc5fdb79
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Every AST unit is created and queried asynchronously, like before, but
we don't wait anymore but use a timer to process new sources. So the server
will not be blocked and can process other messages like cancel.
Change-Id: If0e69466c78f628190f59fd32a03cab1c3a4d0a3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This reduces the overhead when a new message needs to be added.
Change-Id: I5bb2833af2f06f2a8e101cfb03f75ffc2927bf68
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
In the example below, "var" is highlighted as a function, but it should
be highlighted as a local variable.
struct OtherOperator { void operator()(int); };
void g(OtherOperator o, int var)
{
o(var);
}
This is due to a libclang bug.
Change-Id: I7c9fcad6f16c25191d31fc330e969ebd282d4869
Reviewed-by: David Schulz <david.schulz@qt.io>
mock-matchers.h:204:60: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
bool operator()(const A& a, const B& b) const { return a == b; }
~~^~~~
Change-Id: I58883118e1eb42f2e0129b760cdce07daf4ac8d3
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Utf8String is allocating memory but for many compares it is not needed.
In an inner loop this can be expensive.
Change-Id: I6320823ab7e086008447eea255e52859a7faaad7
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Do not add space before left paren in function
because it must not be there
Task-number: QTCREATORBUG-14878
Change-Id: I0fd0e650aeeee59af7bbc157c2fae652109763bc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
...to avoid ambiguity in regard to a new enum in a follow-up change.
Change-Id: I4f732b5200ed674b6708510ac8de0a795afe52da
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Converting them in a Utf8String in an inner loop can be quite heavy.
Change-Id: I4f2ccde47a6e3ca08ed054462eb7772ded9e55c9
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Do not complete -> and . with global completions if
foo is a ptr/ref to forward-declared class.
Change-Id: I41e6745ffb07be1d973fe6a8132824f1b3bf7fb1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Fix templates highlight and completion on Windows
Add UI to turn on/off delayed parsing (off by default)
Task-number: QTCREATORBUG-17222
Change-Id: I0cd5e0bcfff2789cd938e4096829f777ff15957a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
libClang categorizes these as keywords, so we need to check
if a keyword is actually a primitive type, and use that.
Task-number: QTCREATORBUG-17867
Change-Id: I354bb0422505ed7732a0799d9c86d3acfdeb0785
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
For "foo(|" [1] we requested a completion from libclang with the cursor
position just before "foo" and then filtered the function declarations
for functions matching the name "foo". This worked fine for ordinary
functions, but obviously not for constructors and functors.
Recent versions of libclang support proper function call completion with
XCursor_OverloadCandidate, so make use of that.
[1] '|' represents the cursor position
Task-number: QTCREATORBUG-14882
Task-number: QTCREATORBUG-14884
Change-Id: I9d31b3960ccff6a8b9440dbcb7ff9f5ca9f61266
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
...with new project arguments.
Reproduce with:
1. Open a file with some #ifdef
2. Edit the file, e.g. type space.
3. Change the build configuration so that the highlighting flips in the
editor.
4. Edit the file again, the configuration flips again [repeat].
Change-Id: Ib97c18fc46538d74c63972e682a348ae2736a4e6
Reviewed-by: David Schulz <david.schulz@qt.io>
This simplifies the high level client ClangCodeModelServer and removes
quite some duplication in tests.
Change-Id: I4c6ab8646c8728990ebaca2b920ae514e949c54a
Reviewed-by: David Schulz <david.schulz@qt.io>
...because the flag can be set for needed parses, too.
Change-Id: I8b328afefb282cb6bd1cf88711af3d08a56808db
Reviewed-by: David Schulz <david.schulz@qt.io>
Looks like this was fixed in libclang in the meanwhile.
Change-Id: I51200ef7c72a01f5075d2e5d6ca6db4690dfcdd0
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
- Avoids the hassle of QRC files and manually registering mime types
- Avoids performance regressions because of mime types that are
registered after mime database has been used
- Makes it technically possible to detect that a disabled plugin could
handle a mime type if it was enabled
Change-Id: I373008b1b56e9c6b4853055f20b3eeb112a6eff9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>