From bbc48690e85adbe5ea8a5ffe14d5ba26fc7a3b7c Mon Sep 17 00:00:00 2001
From: Christian Kamm <christian.d.kamm@nokia.com>
Date: Wed, 14 Sep 2011 09:59:05 +0200
Subject: [PATCH] QmlJS highlighting: Fix external object property highlight.

Change-Id: Ie9fa9aceb72c40ca2f991f48f70f89e5ab342436
Reviewed-on: http://codereview.qt-project.org/4870
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
---
 src/plugins/qmljseditor/qmljssemantichighlighter.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/plugins/qmljseditor/qmljssemantichighlighter.cpp b/src/plugins/qmljseditor/qmljssemantichighlighter.cpp
index dab142f85c8..f3928ee9c4e 100644
--- a/src/plugins/qmljseditor/qmljssemantichighlighter.cpp
+++ b/src/plugins/qmljseditor/qmljssemantichighlighter.cpp
@@ -240,12 +240,13 @@ protected:
                 type = SemanticHighlighter::ExternalIdType;
             } else if (scope == chain->rootObjectScope()) {
                 type = SemanticHighlighter::RootObjectPropertyType;
+            } else  { // check for this?
+                type = SemanticHighlighter::ExternalObjectPropertyType;
             }
-        } else { // check for this?
-            type = SemanticHighlighter::ExternalObjectPropertyType;
         }
 
-        addUse(location, type);
+        if (type != SemanticHighlighter::UnknownType)
+            addUse(location, type);
     }
 
     bool visit(UiObjectDefinition *ast)
-- 
GitLab