summaryrefslogtreecommitdiff
path: root/src/plugins/qmljseditor/qmljssemantichighlighter.cpp
diff options
context:
space:
mode:
authorFawzi Mohamed <fawzi.mohamed@digia.com>2013-03-05 14:35:15 +0100
committerFawzi Mohamed <fawzi.mohamed@digia.com>2013-03-05 15:30:23 +0100
commitef42f53f22ebc7be3df3ee2b6ead7fc7e796328e (patch)
tree9365012f03461699a14fe5c6c802a44dd0bb69d3 /src/plugins/qmljseditor/qmljssemantichighlighter.cpp
parentc933d42370492db2e45178b03d204d19a923216b (diff)
downloadqt-creator-ef42f53f22ebc7be3df3ee2b6ead7fc7e796328e.tar.gz
qmljs: do not show warnings for not fully supported languages
Change-Id: Ie153caefcbb0f5d6d627697fd324d0cd0e3fa31f Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/plugins/qmljseditor/qmljssemantichighlighter.cpp')
-rw-r--r--src/plugins/qmljseditor/qmljssemantichighlighter.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/plugins/qmljseditor/qmljssemantichighlighter.cpp b/src/plugins/qmljseditor/qmljssemantichighlighter.cpp
index e31b900a36..5b040450f1 100644
--- a/src/plugins/qmljseditor/qmljssemantichighlighter.cpp
+++ b/src/plugins/qmljseditor/qmljssemantichighlighter.cpp
@@ -429,17 +429,20 @@ protected:
private:
void run()
{
- int nMessages = m_scopeChain.document()->diagnosticMessages().size()
- + m_semanticInfo.semanticMessages.size()
- + m_semanticInfo.staticAnalysisMessages.size();
- m_delayedUses.reserve(nMessages);
- m_diagnosticRanges.reserve(nMessages);
- m_extraFormats.reserve(nMessages);
- addMessages(m_scopeChain.document()->diagnosticMessages(), m_scopeChain.document());
- addMessages(m_semanticInfo.semanticMessages, m_semanticInfo.document);
- addMessages(m_semanticInfo.staticAnalysisMessages, m_semanticInfo.document);
-
- qSort(m_delayedUses.begin(), m_delayedUses.end(), sortByLinePredicate);
+ int nMessages = 0;
+ if (Document::isFullySupportedLanguage(m_scopeChain.document()->language())) {
+ nMessages = m_scopeChain.document()->diagnosticMessages().size()
+ + m_semanticInfo.semanticMessages.size()
+ + m_semanticInfo.staticAnalysisMessages.size();
+ m_delayedUses.reserve(nMessages);
+ m_diagnosticRanges.reserve(nMessages);
+ m_extraFormats.reserve(nMessages);
+ addMessages(m_scopeChain.document()->diagnosticMessages(), m_scopeChain.document());
+ addMessages(m_semanticInfo.semanticMessages, m_semanticInfo.document);
+ addMessages(m_semanticInfo.staticAnalysisMessages, m_semanticInfo.document);
+
+ qSort(m_delayedUses.begin(), m_delayedUses.end(), sortByLinePredicate);
+ }
m_currentDelayedUse = 0;
m_semanticHighlighter.reportMessagesInfo(m_diagnosticRanges, m_extraFormats);