forked from qt-creator/qt-creator
Use FileName in TextMark
Change-Id: I3666d95dc8ef3b7da099d6d30f5cb4678a349493 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -610,8 +610,7 @@ void QmlJSEditorDocumentPrivate::createTextMarks(const QList<DiagnosticMessage>
|
||||
delete mark;
|
||||
};
|
||||
|
||||
auto mark = new QmlJSTextMark(q->filePath().toString(),
|
||||
diagnostic, onMarkRemoved);
|
||||
auto mark = new QmlJSTextMark(q->filePath(), diagnostic, onMarkRemoved);
|
||||
m_diagnosticMarks.append(mark);
|
||||
q->addMark(mark);
|
||||
}
|
||||
@@ -630,13 +629,13 @@ void QmlJSEditorDocumentPrivate::createTextMarks(const SemanticInfo &info)
|
||||
delete mark;
|
||||
};
|
||||
for (const DiagnosticMessage &diagnostic : qAsConst(info.semanticMessages)) {
|
||||
auto mark = new QmlJSTextMark(q->filePath().toString(),
|
||||
auto mark = new QmlJSTextMark(q->filePath(),
|
||||
diagnostic, onMarkRemoved);
|
||||
m_semanticMarks.append(mark);
|
||||
q->addMark(mark);
|
||||
}
|
||||
for (const QmlJS::StaticAnalysis::Message &message : qAsConst(info.staticAnalysisMessages)) {
|
||||
auto mark = new QmlJSTextMark(q->filePath().toString(),
|
||||
auto mark = new QmlJSTextMark(q->filePath(),
|
||||
message, onMarkRemoved);
|
||||
m_semanticMarks.append(mark);
|
||||
q->addMark(mark);
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
using namespace QmlJSEditor;
|
||||
using namespace QmlJSEditor::Internal;
|
||||
using namespace Utils;
|
||||
|
||||
using namespace TextEditor;
|
||||
|
||||
@@ -58,7 +59,7 @@ static Core::Id cartegoryForSeverity(QmlJS::Severity::Enum kind)
|
||||
return isWarning(kind) ? QMLJS_WARNING : QMLJS_ERROR;
|
||||
}
|
||||
|
||||
QmlJSTextMark::QmlJSTextMark(const QString &fileName,
|
||||
QmlJSTextMark::QmlJSTextMark(const FileName &fileName,
|
||||
const QmlJS::DiagnosticMessage &diagnostic,
|
||||
const QmlJSTextMark::RemovedFromEditorHandler &removedHandler)
|
||||
: TextEditor::TextMark(fileName, int(diagnostic.loc.startLine),
|
||||
@@ -69,7 +70,7 @@ QmlJSTextMark::QmlJSTextMark(const QString &fileName,
|
||||
init(isWarning(diagnostic.kind), diagnostic.message);
|
||||
}
|
||||
|
||||
QmlJSTextMark::QmlJSTextMark(const QString &fileName,
|
||||
QmlJSTextMark::QmlJSTextMark(const FileName &fileName,
|
||||
const QmlJS::StaticAnalysis::Message &message,
|
||||
const QmlJSTextMark::RemovedFromEditorHandler &removedHandler)
|
||||
: TextEditor::TextMark(fileName, int(message.location.startLine),
|
||||
|
||||
@@ -38,10 +38,10 @@ class QmlJSTextMark : public TextEditor::TextMark
|
||||
public:
|
||||
using RemovedFromEditorHandler = std::function<void(QmlJSTextMark *)>;
|
||||
|
||||
QmlJSTextMark(const QString &fileName,
|
||||
QmlJSTextMark(const Utils::FileName &fileName,
|
||||
const QmlJS::DiagnosticMessage &diagnostic,
|
||||
const RemovedFromEditorHandler &removedHandler);
|
||||
QmlJSTextMark(const QString &fileName,
|
||||
QmlJSTextMark(const Utils::FileName &fileName,
|
||||
const QmlJS::StaticAnalysis::Message &message,
|
||||
const RemovedFromEditorHandler &removedHandler);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user