[prev in list] [next in list] [prev in thread] [next in thread]
List: kdevelop-bugs
Subject: [Bug 99964] ctags does not work well with macros
From: kdevelop-bugs-admin () barney ! cs ! uni-potsdam ! de
Date: 2005-04-22 21:47:13
Message-ID: 20050422214713.21022.qmail () ktown ! kde ! org
[Download RAW message or body]
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=99964
jens.dagerbo swipnet se changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
------- Additional Comments From jens.dagerbo swipnet se 2005-04-22 23:47 -------
CVS commit by dagerbo:
Fix go to definition for macros
BUG: 99964
M +23 -5 ctags2_part.cpp 1.13
--- kdevelop/parts/ctags2/ctags2_part.cpp #1.12:1.13
@ -241,8 +241,25 @ void CTags2Part::slotGotoDeclaration( )
int CTags2Part::getFileLineFromStream( QTextStream & istream, QString const & pattern )
{
+ if ( pattern.isEmpty() ) return -1;
- QString reduced = pattern.mid( 2, pattern.length() -4 );
- QString escaped = QRegExp::escape( reduced );
- QString re_string( "^" + escaped + "$" );
+ // most of the time, the ctags pattern has the form /^foo$/
+ // but this isn't true for some macro definitions
+ // where the form is only /^foo/
+ // I have no idea if this is a ctags bug or not, but we have to deal with it
+
+ QString reduced, escaped, re_string;
+ if ( pattern.endsWith( "$/" ) )
+ {
+
+ reduced = pattern.mid( 2, pattern.length() -4 );
+ escaped = QRegExp::escape( reduced );
+ re_string = QString( "^" + escaped + "$" );
+ }
+ else
+ {
+ reduced = pattern.mid( 2, pattern.length() -3 );
+ escaped = QRegExp::escape( reduced );
+ re_string = QString( "^" + escaped );
+ }
QRegExp re( re_string );
@ -251,5 +268,6 @ int CTags2Part::getFileLineFromStream( Q
while ( !istream.atEnd() )
{
- if ( re.exactMatch( istream.readLine() ) )
+// if ( re.exactMatch( istream.readLine() ) )
+ if ( re.search( istream.readLine() ) > -1 )
{
return n;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic