diff --git a/src/libs/cplusplus/BackwardsScanner.cpp b/src/libs/cplusplus/BackwardsScanner.cpp
index 93db1209b94d226b340a8e203b8ec9fa93ecbe51..7fde8e499bb47788013a4348bc27727757a7487c 100644
--- a/src/libs/cplusplus/BackwardsScanner.cpp
+++ b/src/libs/cplusplus/BackwardsScanner.cpp
@@ -33,14 +33,17 @@
 
 using namespace CPlusPlus;
 
-BackwardsScanner::BackwardsScanner(const QTextCursor &cursor, int maxBlockCount, const QString &suffix)
+BackwardsScanner::BackwardsScanner(const QTextCursor &cursor,
+                                   int maxBlockCount,
+                                   const QString &suffix,
+                                   bool skipComments)
     : _offset(0)
     , _blocksTokenized(0)
     , _block(cursor.block())
     , _maxBlockCount(maxBlockCount)
 {
     _tokenize.setQtMocRunEnabled(true);
-    _tokenize.setSkipComments(true);
+    _tokenize.setSkipComments(skipComments);
     _tokenize.setObjCEnabled(true);
     _text = _block.text().left(cursor.position() - cursor.block().position());
 
diff --git a/src/libs/cplusplus/BackwardsScanner.h b/src/libs/cplusplus/BackwardsScanner.h
index a2cb6e6ac3b72534975a4963072280dde523937a..b929ed0df42aece32a737b9565a301566a2e71ba 100644
--- a/src/libs/cplusplus/BackwardsScanner.h
+++ b/src/libs/cplusplus/BackwardsScanner.h
@@ -43,7 +43,8 @@ class CPLUSPLUS_EXPORT BackwardsScanner
 public:
     explicit BackwardsScanner(const QTextCursor &cursor,
                               int maxBlockCount = MAX_BLOCK_COUNT,
-                              const QString &suffix = QString());
+                              const QString &suffix = QString(),
+                              bool skipComments = true);
 
     int startToken() const;