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

List:       kde-commits
Subject:    KDE/kdevplatform/language/duchain/builders
From:       Nikolaus Sams <niko.sams () gmail ! com>
Date:       2008-11-04 21:11:39
Message-ID: 1225833099.766546.18730.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 880157 by nsams:

Add a new virtual function newTopContext so a language can create a custom \
TopDUContext


 M  +14 -2     abstractcontextbuilder.h  


--- trunk/KDE/kdevplatform/language/duchain/builders/abstractcontextbuilder.h \
#880156:880157 @@ -141,8 +141,7 @@
       {
         kDebug() << "compiling";
         LockedSmartInterface iface = m_editor->smart();
-        top = new TopDUContext( m_editor->currentUrl(),
-                                iface.currentDocument()
+        top = newTopContext( iface.currentDocument()
                                     ? SimpleRange( \
                iface.currentDocument()->documentRange() )
                                     : SimpleRange( SimpleCursor( 0, 0 ), \
                SimpleCursor( INT_MAX, INT_MAX ) ) );
         top->setSmartRange( m_editor->topRange( iface, \
EditorIntegrator::DefinitionUseChain ), DocumentRangeObject::Own ); @@ -282,6 +281,19 \
@@  return new DUContext(range, currentContext());
   }
 
+  /**
+   * Create a new TopDUContext from the given \a range.
+   *
+   * This exists so that you can create custom TopDUContext subclasses for your
+   * language if you need to.
+   *
+   * \returns the newly created context
+   */
+  virtual TopDUContext* newTopContext(const SimpleRange& range, \
ParsingEnvironmentFile* file = 0) +  {
+    return new TopDUContext(m_editor->currentUrl(), range, file);
+  }
+
   /// Determine the currently open context. \returns the current context.
   inline DUContext* currentContext() const { return m_contextStack.top(); }
   /// Determine the last closed context. \returns the last closed context.


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

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