[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/kdevelop/3.4/languages/cpp
From:       Jens Dagerbo <jens.dagerbo () swipnet ! se>
Date:       2007-02-12 18:07:55
Message-ID: 1171303675.356805.32715.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 632932 by dagerbo:

Extend "jump to declaration"  to include variable declarations.

Patch by Kris Wong. Thanks!

 M  +17 -11    cppcodecompletion.cpp  


--- branches/kdevelop/3.4/languages/cpp/cppcodecompletion.cpp #632931:632932
@@ -4215,21 +4215,27 @@
 	
 	EvaluationResult result = evaluateExpressionAt( line, column, conf );
 	
-	TypeDesc type = result.resultType;
-	
-	if ( type.resolved() ) 
+	DeclarationInfo d = result.sourceVariable;
+	if ( !d )
 	{
-		if ( type.resolved()->asFunction() ) 
+		LocateResult type = result.resultType;
+		if ( type && type->resolved() )
 		{
-			DeclarationInfo d = type.resolved()->getDeclarationInfo();
-			QString fileName = d.file == "current_file" ? m_activeFileName : d.file.operator QString();
-			
-			if ( f == Definition && m_pSupport->switchHeaderImpl( fileName, d.startLine, d.startCol ) )
-				return;
-			
-			m_pSupport->partController()->editDocument( fileName, d.startLine );
+			if ( type->resolved()->asFunction() )
+			{
+				d = type->resolved()->getDeclarationInfo();
+			}
 		}
 	}
+	if ( d )
+	{
+		QString fileName = d.file == "current_file" ? m_activeFileName : d.file.operator QString();
+		
+		if ( f == Definition && m_pSupport->switchHeaderImpl( fileName, d.startLine, d.startCol ) )
+			return;
+		
+		m_pSupport->partController()->editDocument( fileName, d.startLine );
+	}
 }
 
 QString CppCodeCompletion::createTypeInfoString( int line, int column ) 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic