diff options
author | Francois Ferrand <thetypz@gmail.com> | 2010-10-18 17:45:49 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2012-03-29 14:53:48 +0200 |
commit | e639a2381fd755819cb93992c66dca03bb225f83 (patch) | |
tree | 31a9655a7c3baf18e77a4090318659fb975481e2 /src/plugins/cppeditor | |
parent | 6c24b8b74075807e48d27d1be052d6f7d4950540 (diff) | |
download | qt-creator-e639a2381fd755819cb93992c66dca03bb225f83.tar.gz |
CppHighlighter: highlight all functions/methods.
- Highlight all function/methods (not just virtual methods).
- Highlight as a function even if number of arguments does not match. In
that case, add a diagnostic message to indicate there are too many/too
few arguments.
- Fix highlighting of parameters in function declarations.
These used to be handled indiferently, and they could be mistaken for
type or field references.
- Properly highlight template method calls.
Change-Id: I6ab463996dda47554839f482da47f561f76663a7
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
Diffstat (limited to 'src/plugins/cppeditor')
-rw-r--r-- | src/plugins/cppeditor/cppeditor.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index b18cc1dacb..566b5b634c 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -1047,6 +1047,11 @@ void CPPEditorWidget::finishHighlightSymbolUsages() TextEditor::SemanticHighlighter::clearExtraAdditionalFormatsUntilEnd( highlighter, m_highlighter); + + if (m_modelManager) + m_modelManager->setExtraDiagnostics(m_lastSemanticInfo.doc->fileName(), + CPlusPlus::CppModelManagerInterface::CppSemanticsDiagnostic, + m_lastSemanticInfo.doc->diagnosticMessages()); } @@ -1743,6 +1748,8 @@ void CPPEditorWidget::setFontSettings(const TextEditor::FontSettings &fs) fs.toTextCharFormat(QLatin1String(TextEditor::Constants::C_VIRTUAL_METHOD)); m_semanticHighlightFormatMap[SemanticInfo::LabelUse] = fs.toTextCharFormat(QLatin1String(TextEditor::Constants::C_LABEL)); + m_semanticHighlightFormatMap[SemanticInfo::FunctionUse] = + fs.toTextCharFormat(QLatin1String(TextEditor::Constants::C_FUNCTION)); m_keywordFormat = fs.toTextCharFormat(QLatin1String(TextEditor::Constants::C_KEYWORD)); // only set the background, we do not want to modify foreground properties set by the syntax highlighter or the link |