diff --git a/src/plugins/qmljseditor/qmljssemantichighlighter.cpp b/src/plugins/qmljseditor/qmljssemantichighlighter.cpp index 65e9b0ca2e5..b9ef9dc7469 100644 --- a/src/plugins/qmljseditor/qmljssemantichighlighter.cpp +++ b/src/plugins/qmljseditor/qmljssemantichighlighter.cpp @@ -269,8 +269,11 @@ protected: } } - if (type != SemanticHighlighter::UnknownType) - addUse(location, type); + if (type != SemanticHighlighter::UnknownType) { + // do not add uses of length 0 - this messes up highlighting (e.g. anon functions) + if (location.length != 0) + addUse(location, type); + } } void processTypeId(UiQualifiedId *typeId)