diff --git a/languages/cpp/CMakeLists.txt b/languages/cpp/CMakeLists.txt
index 8b47acc..8b45493 100644
--- a/languages/cpp/CMakeLists.txt
+++ b/languages/cpp/CMakeLists.txt
@@ -52,6 +52,7 @@ set(kdevcpplanguagesupport_PART_SRCS
     codegen/progressdialogs.cpp
     codegen/codeassistant.cpp
     codegen/signatureassistant.cpp
+    codegen/renameassistant.cpp
     codegen/unresolvedincludeassistant.cpp
 #     codegen/makeimplementationprivate.cpp
 )
diff --git a/languages/cpp/codegen/codeassistant.cpp b/languages/cpp/codegen/codeassistant.cpp
index 6339a66..597762f 100644
--- a/languages/cpp/codegen/codeassistant.cpp
+++ b/languages/cpp/codegen/codeassistant.cpp
@@ -61,7 +61,7 @@ void StaticCodeAssistant::documentLoaded(KDevelop::IDocument* document) {
   {
     ///@todo Make these connections non-queued, and then reach forward using a QPointer, since else a crash may happen when the document is destroyed before the message is processed
     connect(document->textDocument(), SIGNAL(textInserted(KTextEditor::Document*,KTextEditor::Range)), SLOT(textInserted(KTextEditor::Document*,KTextEditor::Range)));
-    connect(document->textDocument(), SIGNAL(textRemoved(KTextEditor::Document*,KTextEditor::Range)), SLOT(textRemoved(KTextEditor::Document*,KTextEditor::Range)));
+    connect(document->textDocument(), SIGNAL(textRemoved(KTextEditor::Document*,KTextEditor::Range, const QString&)), SLOT(textRemoved(KTextEditor::Document*,KTextEditor::Range, const QString&)));
   }
 }
 
@@ -75,33 +75,37 @@ void StaticCodeAssistant::textInserted(KTextEditor::Document* document, KTextEdi
   QMetaObject::invokeMethod(this, "eventuallyStartAssistant", Qt::QueuedConnection, Q_ARG(SafeDocumentPointer, document), Q_ARG(KTextEditor::Range, range));
 }
 
-void StaticCodeAssistant::textRemoved(KTextEditor::Document* document, KTextEditor::Range range) {
-  range = KTextEditor::Range(range.start(), range.start());
-  QMetaObject::invokeMethod(this, "eventuallyStartAssistant", Qt::QueuedConnection, Q_ARG(SafeDocumentPointer, document), Q_ARG(KTextEditor::Range, range));
+void StaticCodeAssistant::textRemoved(KTextEditor::Document* document, KTextEditor::Range range, const QString &removedText) {
+  QMetaObject::invokeMethod(this, "eventuallyStartAssistant", Qt::QueuedConnection, Q_ARG(SafeDocumentPointer, document), Q_ARG(KTextEditor::Range, range), Q_ARG(const QString&, removedText));
 }
 
-void StaticCodeAssistant::eventuallyStartAssistant(SafeDocumentPointer document, KTextEditor::Range range) {
+void StaticCodeAssistant::eventuallyStartAssistant(SafeDocumentPointer document, KTextEditor::Range range, const QString& removedText) {
 
   if(!document)
     return;
   
-  if(m_activeAssistant) {
-//     kDebug() << "there still is an active assistant";
-//     if(abs(m_activeAssistant->invocationCursor().line() < range.start().line()) >= 1) {
-//       kDebug() << "assistant was not deleted in time";
-//     }else{
-//       return;
-//     }
-  }
   //Eventually pop up an assistant
   if(!document->activeView())
     return;
-  
-  KSharedPtr<AdaptDefinitionSignatureAssistant> signatureAssistant(new AdaptDefinitionSignatureAssistant(document->activeView(), range));
+
+  //FIXME: update signature assistant to ignore renames
+  KTextEditor::Range sigAssistRange = removedText.isEmpty() ? range : KTextEditor::Range(range.start(), range.start());
+  KSharedPtr<AdaptDefinitionSignatureAssistant> signatureAssistant(new AdaptDefinitionSignatureAssistant(document->activeView(), sigAssistRange));
   
   if(signatureAssistant->isUseful()) {
     startAssistant(KSharedPtr<IAssistant>(signatureAssistant.data()));
   }
+
+  //FIXME: get rid of closed views in m_renameAssistants
+
+  if (!m_renameAssistants.contains(document->activeView()))
+    m_renameAssistants[document->activeView()].attach(new RenameAssistant(document->activeView()));
+
+  m_renameAssistants[document->activeView()]->textChanged(range, removedText);
+
+  if(m_renameAssistants[document->activeView()]->isUseful()) {
+    startAssistant(KSharedPtr<IAssistant>(m_renameAssistants[document->activeView()].data()));
+  }
 }
 
 void StaticCodeAssistant::startAssistant(KSharedPtr< KDevelop::IAssistant > assistant, bool manage) {
diff --git a/languages/cpp/codegen/codeassistant.h b/languages/cpp/codegen/codeassistant.h
index 8443b6f..3df30b0 100644
--- a/languages/cpp/codegen/codeassistant.h
+++ b/languages/cpp/codegen/codeassistant.h
@@ -27,6 +27,7 @@
 #include <language/duchain/indexedstring.h>
 #include <language/duchain/types/indexedtype.h>
 #include <QTimer>
+#include "renameassistant.h"
 
 typedef QPointer<KTextEditor::Document> SafeDocumentPointer;
 
@@ -51,12 +52,12 @@ class StaticCodeAssistant : public QObject {
     void assistantHide();
     void documentLoaded(KDevelop::IDocument*);
     void textInserted(KTextEditor::Document*,KTextEditor::Range);
-    void textRemoved(KTextEditor::Document*,KTextEditor::Range);
+    void textRemoved(KTextEditor::Document*,KTextEditor::Range,const QString& removedText);
     void parseJobFinished(KDevelop::ParseJob*);
     void documentActivated(KDevelop::IDocument*);
     void cursorPositionChanged(KTextEditor::View*,KTextEditor::Cursor);
     void timeout();
-    void eventuallyStartAssistant(SafeDocumentPointer, KTextEditor::Range range);
+    void eventuallyStartAssistant(SafeDocumentPointer document, KTextEditor::Range range, const QString& removedText = QString());
   private:
     void checkAssistantForProblems(KDevelop::TopDUContext* top);
     ///@param manage If this is true, the static code-assistant manages the hiding of the assistant
@@ -66,6 +67,7 @@ class StaticCodeAssistant : public QObject {
     KTextEditor::Cursor m_assistantStartedAt;
     KDevelop::IndexedString m_currentDocument;
     KSharedPtr<KDevelop::IAssistant> m_activeAssistant;
+    QHash< KTextEditor::View*, KSharedPtr<RenameAssistant> > m_renameAssistants;
     bool m_activeProblemAssistant;
     QTimer* m_timer;
     
