@ -2050,14 +2050,13 @@ void CppCodeCompletion::needRecoveryPoints() {
if ( this - > d - > recoveryPoints . isEmpty ( ) ) {
kdDebug ( 9007 ) < < " missing recovery-points for file " < < m_activeFileName < < " they have to be computed now " < < endl ;
m_pSupport - > backgroundParser ( ) - > lock ( )
;
m_pSupport - > backgroundParser ( ) - > lock ( ) ;
std : : vector < CppCodeCompletion > vec ;
TranslationUnitAST * ast = * m_pSupport - > backgroundParser ( ) - > translationUnit ( m_activeFileName ) ;
ParsedFilePointer pTransUnit = m_pSupport - > backgroundParser ( ) - > translationUnit ( m_activeFileName ) ;
m_pSupport - > backgroundParser ( ) - > unlock ( ) ;
if ( ! ast ) {
if ( ! pTr an sUni t ) {
kdDebug ( 9007 ) < < " background-parser is missing the translation-unit. The file needs to be reparsed. " < < endl ;
m_pSupport - > parseFileAndDependencies ( m_activeFileName , true ) ;
// m_pSupport->mainWindow() ->statusBar() ->message( i18n( "Background-parser is missing the necessary translation-unit. It will be computed, but this completion will fail." ).arg( m_activeFileName ), 2000 );
@ -2684,7 +2683,10 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
///@todo is all this necessary?
if ( ! recoveredDecl . get ( ) & & ! recoveredTypeSpec . get ( ) ) {
TranslationUnitAST * ast = * m_pSupport - > backgroundParser ( ) - > translationUnit ( m_activeFileName ) ;
ParsedFilePointer pTransUnit = m_pSupport - > backgroundParser ( ) - > translationUnit ( m_activeFileName ) ;
if ( pTransUnit )
{
TranslationUnitAST * ast = * pTransUnit ;
if ( AST * node = findNodeAt ( ast , line , column ) ) {
kdDebug ( 9007 ) < < " ------------------- AST FOUND -------------------- " < < endl ;
kdDebug ( 9007 ) < < " node-kind = " < < nodeTypeToString ( node - > nodeType ( ) ) < < endl ;
@ -2751,6 +2753,7 @@ void CppCodeCompletion::completeText( bool invokedOnDemand /*= false*/ ) {
}
}
}
}
if ( ! ctx )
return ;