[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdevelop/languages/cpp
From: Adam Treat <manyoso () yahoo ! com>
Date: 2005-03-11 18:04:30
Message-ID: 20050311180430.CB404EED3 () office ! kde ! org
[Download RAW message or body]
CVS commit by treat:
* Add support for completion in try/catch blocks
BUGS:80671
M +37 -0 cppcodecompletion.cpp 1.164
M +3 -0 cppcodecompletion.h 1.56
--- kdevelop/languages/cpp/cppcodecompletion.cpp #1.163:1.164
@@ -1480,4 +1480,7 @@ void CppCodeCompletion::computeContext(
computeContext( ctx, static_cast<SwitchStatementAST*>( stmt ), line, col );
break;
+ case NodeType_TryBlockStatement:
+ computeContext( ctx, static_cast<TryBlockStatementAST*>( stmt ), line, col );
+ break;
case NodeType_DeclarationStatement:
computeContext( ctx, static_cast<DeclarationStatementAST*>( stmt ), line, col );
@@ -1554,4 +1557,38 @@ void CppCodeCompletion::computeContext(
}
+void CppCodeCompletion::computeContext( SimpleContext*& ctx, TryBlockStatementAST* ast, int line, int col )
+{
+ if ( !inContextScope( ast, line, col ) )
+ return;
+
+ computeContext( ctx, ast->statement(), line, col );
+ computeContext( ctx, ast->catchStatementList(), line, col );
+}
+
+void CppCodeCompletion::computeContext( SimpleContext*& ctx, CatchStatementListAST* ast, int line, int col )
+{
+ if ( !inContextScope( ast, line, col, false, true ) )
+ return;
+
+ QPtrList<CatchStatementAST> l( ast->statementList() );
+ QPtrListIterator<CatchStatementAST> it( l );
+ while ( it.current() )
+ {
+ CatchStatementAST * stmt = it.current();
+ ++it;
+
+ computeContext( ctx, stmt, line, col );
+ }
+}
+
+void CppCodeCompletion::computeContext( SimpleContext*& ctx, CatchStatementAST* ast, int line, int col )
+{
+ if ( !inContextScope( ast, line, col ) )
+ return;
+
+ computeContext( ctx, ast->condition(), line, col );
+ computeContext( ctx, ast->statement(), line, col );
+}
+
void CppCodeCompletion::computeContext( SimpleContext*& ctx, DeclarationStatementAST* ast, int line, int col )
{
--- kdevelop/languages/cpp/cppcodecompletion.h #1.55:1.56
@@ -129,4 +129,7 @@ private:
void computeContext( SimpleContext*& ctx, WhileStatementAST* ast, int line, int col );
void computeContext( SimpleContext*& ctx, SwitchStatementAST* ast, int line, int col );
+ void computeContext( SimpleContext*& ctx, TryBlockStatementAST* ast, int line, int col );
+ void computeContext( SimpleContext*& ctx, CatchStatementListAST* ast, int line, int col );
+ void computeContext( SimpleContext*& ctx, CatchStatementAST* ast, int line, int col );
void computeContext( SimpleContext*& ctx, DeclarationStatementAST* ast, int line, int col );
void computeContext( SimpleContext*& ctx, ConditionAST* ast, int line, int col );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic