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

Function findProblemsUnderCursor

plugins/contextbrowser/contextbrowser.cpp:454–479  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

452}
453
454static QVector<KDevelop::IProblem::Ptr> findProblemsUnderCursor(TopDUContext* topContext, KTextEditor::Cursor position,
455 KTextEditor::Range& handleRange)
456{
457 QVector<KDevelop::IProblem::Ptr> problems;
458 handleRange = KTextEditor::Range::invalid();
459
460 const auto modelsData = ICore::self()->languageController()->problemModelSet()->models();
461 for (const auto& modelData : modelsData) {
462 const auto modelProblems = modelData.model->problems(topContext->url());
463 for (const auto& problem : modelProblems) {
464 DocumentRange problemRange = problem->finalLocation();
465 if (problemRange.contains(position) ||
466 (problemRange.isEmpty() && problemRange.boundaryAtCursor(position))) {
467 problems += problem;
468 // first?
469 if (!handleRange.isValid()) {
470 handleRange = problemRange;
471 } else {
472 handleRange.confineToRange(problemRange);
473 }
474 }
475 }
476 }
477
478 return problems;
479}
480
481static QVector<KDevelop::IProblem::Ptr> findProblemsCloseToCursor(const TopDUContext* topContext,
482 KTextEditor::Cursor position,

Callers 1

Calls 10

modelsMethod · 0.80
problemModelSetMethod · 0.80
languageControllerMethod · 0.80
invalidFunction · 0.50
problemsMethod · 0.45
urlMethod · 0.45
finalLocationMethod · 0.45
containsMethod · 0.45
isEmptyMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected