MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / addAnnotation

Method addAnnotation

src/plugins/codeeditor/gui/texteditor.cpp:455–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

453}
454
455void TextEditor::addAnnotation(const QString &title, const QString &content, int line, int type)
456{
457 QString typeStr;
458 switch (type) {
459 case dpfservice::Edit::TipAnnotation:
460 typeStr = "Tip";
461 break;
462 case dpfservice::Edit::NoteAnnotation:
463 typeStr = "Note";
464 break;
465 case dpfservice::Edit::ErrorAnnotation:
466 typeStr = "Error";
467 break;
468 case dpfservice::Edit::FatalAnnotation:
469 typeStr = "Fatal";
470 break;
471 case dpfservice::Edit::WarningAnnotation:
472 typeStr = "Warning";
473 break;
474 }
475
476 d->annotationRecords.insertMulti(title, line);
477 static QString formatText("%1:\n%2:\n%3");
478 auto msg = formatText.arg(title, typeStr, content);
479 addAnnotation(msg, line, type);
480}
481
482void TextEditor::addAnnotation(const QString &content, int line, int type)
483{

Callers 1

annotateMethod · 0.80

Calls 1

createAnnotationStyleMethod · 0.80

Tested by

no test coverage detected