forked from qt-creator/qt-creator
C++: fixed completion in braceless statements following a control statement.
- Changed generator to generate: - Changed AST::lastToken to return 1 if there is none - Changed Bind.cpp to set the scope of the block following a control statement to extend upto (and not including) the first token after the block. So basically, including any whitespace after the control statement. Reviewed-by: Roberto Raggi
This commit is contained in:
@@ -184,10 +184,9 @@ int CppRefactoringFile::endOf(unsigned index) const
|
||||
|
||||
int CppRefactoringFile::endOf(const AST *ast) const
|
||||
{
|
||||
if (unsigned end = ast->lastToken())
|
||||
return endOf(end - 1);
|
||||
else
|
||||
return 0;
|
||||
unsigned end = ast->lastToken();
|
||||
Q_ASSERT(end > 0);
|
||||
return endOf(end - 1);
|
||||
}
|
||||
|
||||
void CppRefactoringFile::startAndEndOf(unsigned index, int *start, int *end) const
|
||||
|
||||
Reference in New Issue
Block a user