MCPcopy Create free account
hub / github.com/KDE/kdevelop / documentMarks

Method documentMarks

kdevplatform/debugger/tests/test_breakpointmodel.cpp:126–143  ·  view source on GitHub ↗

Gather breakpoint marks in the document. @return line numbers as int keys and BreakpointModel::MarkType (possibly a bitwise-or combination of) as mapped values.

Source from the content-addressed store, hash-verified

124/// Gather breakpoint marks in the document.
125/// @return line numbers as int keys and BreakpointModel::MarkType (possibly a bitwise-or combination of) as mapped values.
126TestBreakpointModel::DocumentMarks TestBreakpointModel::documentMarks(const IDocument* doc)
127{
128 DocumentMarks ret;
129 // if it is not possible to get marks, fail.
130 QVERIFY_RETURN(doc, ret);
131 auto* const textDocument = doc->textDocument();
132 QVERIFY_RETURN(textDocument, ret);
133
134 const auto marks = textDocument->marks();
135 for (const auto* mark : marks) {
136 // mask to remove non-breakpoint mark type bits.
137 const auto type = mark->type & BreakpointModel::AllBreakpointMarks;
138 if (type) {
139 ret.insert(mark->line, static_cast<BreakpointModel::MarkType>(type));
140 }
141 }
142 return ret;
143}
144
145/// Print sections of example code.
146/// Used for checking what edited text looks like when writing tests.

Callers

nothing calls this directly

Calls 2

textDocumentMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected