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

List:       kde-commits
Subject:    KDE/kdevplatform/language/duchain/builders
From:       David Nolden <david.nolden.kde () art-master ! de>
Date:       2008-09-15 19:59:17
Message-ID: 1221508757.216391.11225.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 861315 by zwabel:

Ignore the ranges while updating named contexts. This should work around some \
problems in the editor, where ranges sometimes are not correctly transformed through \
edits, leading to massive re-creating of ranges and contexts, making the UI very very \
sluggish while it happens.



 M  +14 -7     abstractcontextbuilder.h  


--- trunk/KDE/kdevplatform/language/duchain/builders/abstractcontextbuilder.h \
#861314:861315 @@ -690,15 +690,20 @@
         {
           DUContext* child = childContexts.at( nextContextIndex() );
 
-          if ( child->range().start > translated.end && child->smartRange() ) {
-#ifdef DEBUG_UPDATE_MATCHING
-              kDebug() << "While searching" << identifier << translated.textRange() \
<< "(from" << range.textRange() << ") stopping because found" << \
                child->localScopeIdentifier() << child->range().textRange();
-#endif
-              break;
-          }
+//           if ( child->range().start > translated.end && child->smartRange() ) {
+// #ifdef DEBUG_UPDATE_MATCHING
+//               kDebug() << "While searching" << identifier << \
translated.textRange() << "(from" << range.textRange() << ") stopping because found" \
<< child->localScopeIdentifier() << child->range().textRange(); +// #endif
+//               break;
+//           }
 
-          if ( child->type() == type && child->localScopeIdentifier() == identifier \
&& child->range() == translated ) +	  //For unnamed child-ranges, we still do \
range-comparison, because we cannot distinguish them in other ways +          if ( \
child->type() == type && child->localScopeIdentifier() == identifier && \
(!identifier.isEmpty() || child->range() == translated) )  {
+            if(child->range() != translated && child->smartRange()) {
+              kDebug() << "range mismatch while updating context. Range:" << \
child->range().textRange() << "should be:" << translated.textRange(); +              \
break; +            }
             // No need to have the translated range accurate any more
             // Also we can't unlock after the duchain lock is unlocked
             iface.unlock();
@@ -723,6 +728,8 @@
 
             kDebug() << "skipping range" << \
childContexts.at(nextContextIndex())->localScopeIdentifier() << \
childContexts.at(nextContextIndex())->range().textRange();  #endif
+	  if ( child->range().start > translated.end && child->smartRange() && \
(nextContextIndex()+1 == childContexts.count() || \
(childContexts.at(nextContextIndex()+1)->localScopeIdentifier() != identifier || \
childContexts.at(nextContextIndex()+1)->type() != type)) ) +	    break; //Don't move \
the nextContextIndex() too far  }
         }
       }


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

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