forked from qt-creator/qt-creator
		
	Merge remote-tracking branch 'origin/3.6'
Change-Id: I8223551aec66539dd8c55262e5000c1621410334
This commit is contained in:
		@@ -34,6 +34,9 @@
 | 
			
		||||
#include "cpptoolsreuse.h"
 | 
			
		||||
#include "editordocumenthandle.h"
 | 
			
		||||
 | 
			
		||||
#include <texteditor/fontsettings.h>
 | 
			
		||||
#include <texteditor/texteditorsettings.h>
 | 
			
		||||
 | 
			
		||||
#include <utils/qtcassert.h>
 | 
			
		||||
 | 
			
		||||
#include <QTextBlock>
 | 
			
		||||
@@ -82,15 +85,10 @@ QList<QTextEdit::ExtraSelection> BaseEditorDocumentProcessor::toTextEditorSelect
 | 
			
		||||
        const QList<CPlusPlus::Document::DiagnosticMessage> &diagnostics,
 | 
			
		||||
        QTextDocument *textDocument)
 | 
			
		||||
{
 | 
			
		||||
    // Format for errors
 | 
			
		||||
    QTextCharFormat errorFormat;
 | 
			
		||||
    errorFormat.setUnderlineStyle(QTextCharFormat::SingleUnderline);
 | 
			
		||||
    errorFormat.setUnderlineColor(Qt::red);
 | 
			
		||||
    const TextEditor::FontSettings &fontSettings = TextEditor::TextEditorSettings::instance()->fontSettings();
 | 
			
		||||
 | 
			
		||||
    // Format for warnings
 | 
			
		||||
    QTextCharFormat warningFormat;
 | 
			
		||||
    warningFormat.setUnderlineStyle(QTextCharFormat::SingleUnderline);
 | 
			
		||||
    warningFormat.setUnderlineColor(Qt::darkYellow);
 | 
			
		||||
    QTextCharFormat warningFormat = fontSettings.toTextCharFormat(TextEditor::C_WARNING);
 | 
			
		||||
    QTextCharFormat errorFormat = fontSettings.toTextCharFormat(TextEditor::C_ERROR);
 | 
			
		||||
 | 
			
		||||
    QList<QTextEdit::ExtraSelection> result;
 | 
			
		||||
    foreach (const CPlusPlus::Document::DiagnosticMessage &m, diagnostics) {
 | 
			
		||||
 
 | 
			
		||||
@@ -190,6 +190,11 @@ void BuiltinEditorDocumentProcessor::recalculateSemanticInfoDetached(bool force)
 | 
			
		||||
void BuiltinEditorDocumentProcessor::semanticRehighlight()
 | 
			
		||||
{
 | 
			
		||||
    if (m_semanticHighlighter && m_semanticInfoUpdater.semanticInfo().doc) {
 | 
			
		||||
        if (const CPlusPlus::Document::Ptr document = m_documentSnapshot.document(filePath())) {
 | 
			
		||||
            m_codeWarnings = toTextEditorSelections(document->diagnosticMessages(), textDocument());
 | 
			
		||||
            m_codeWarningsUpdated = false;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        m_semanticHighlighter->updateFormatMapFromFontSettings();
 | 
			
		||||
        m_semanticHighlighter->run();
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user