forked from qt-creator/qt-creator
Clang: Fix adding completion snippets after {
...e.g. as in "void f() {".
The criteria whether to change snippets got invalidated with
commit 8d0391a4f9
Clang: Treat brace initialization as constructor completion
as the completion operator might be T_LBRACE now instead of T_EOF_SYMBOL
for normal completions.
This fixes the plugin test ClangCodeCompletionTest::testCompleteGlobals.
Add also unit tests.
Change-Id: I85cf522b9b307359c5c3e25198dd228cbb68ded0
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -58,6 +58,7 @@ public:
|
||||
int positionForClang() const { return m_positionForClang; }
|
||||
int functionNameStart() const { return m_functionNameStart; }
|
||||
int positionEndOfExpression() const { return m_positionEndOfExpression; }
|
||||
bool addSnippets() const { return m_addSnippets; }
|
||||
|
||||
private:
|
||||
ClangCompletionContextAnalyzer();
|
||||
@@ -84,6 +85,7 @@ private:
|
||||
int m_positionForClang = -1;
|
||||
int m_functionNameStart = -1;
|
||||
int m_positionEndOfExpression = -1;
|
||||
bool m_addSnippets = false;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user