...and maybe other cases.
Since
Clang: fix findStartOfName handling
commit 82d0650b11
the proposal's base position was calculated wrong. As a result, an early
return triggert in CodeAssistantPrivate::displayProposal (call to
newProposal->hasItemsToPropose(prefix, reason)) and no completions were
displayed.
Fix by ensuring that the added code from the mentioned commit is only
called when needed, namely only for function expressions.
Task-number: QTCREATORBUG-19083
Change-Id: I8f23c9b7186f9d81159939c8b3ef475a09bbe760
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
... to reuse this position in backend (instead of
searching the function start again)
Change-Id: I02818dce4fc37ed6e7ecfb533191dbfe60610204
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>
...that ocurred for e.g. "foo (<COMPLETE HERE>".
We did not handle the following cases:
1) white space after the function name
2) nothing before parenthesis
Change-Id: If6aedd2cc938df30516e13a860d07d7a509633ae
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
...for consistency and to avoid future file name clashes.
Change-Id: If595c8debfa1ceb01a1bb0ed34649fa513660503
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
* Rename some members/functions to clarify their meaning.
* Ensure that the position for the proposal widget is at start of the
identifer, so that the filter prefix will be found correctly in the
GenericProposalWidget. For certain cases the completion were
calculated but the widget was never shown:
Case 1:
void f()
{
<COMPLETION_CURSOR>
}
Case 2:
void f()
{
st<COMPLETION_CURSOR>
}
Case 3:
if (true)
<COMPLETION_CURSOR>
Case 4:
foo. mem<COMPLETION_CURSOR>
Change-Id: Ie79e01e8a22f8ec306136ec4ccbfffd544edd573
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
This makes us independent of libclang crashes for completion.
Re-parsing for highlighting still happens in the Qt Creator process.
Run in verbose mode:
qtc.clangcodemodel.ipc=true
Run tests:
-test "ClangCodeModel"
Task-number: QTCREATORBUG-14108
Task-number: QTCREATORBUG-12819
Change-Id: Id3e95bd2afdb6508bbd1d35fddc69534a909b905
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>