data, ui: comment handling

* CodeView displays comments as atomic regions. They are either displayed as a whole or not at all. Do nothing halfway!
* added CommentHandler that handles comments detected by clang.
* stored CommentLocations in database.
This commit is contained in:
malte_langkabel
2015-11-06 14:03:20 +01:00
parent e186eefdff
commit 50bc970c30
17 changed files with 282 additions and 31 deletions
@@ -257,7 +257,19 @@ std::vector<CodeView::CodeSnippetParams> CodeController::getSnippetsForFile(std:
}
);
ranges = fileScopedMerger.merge();
std::vector<SnippetMerger::Range> atomicRanges;
m_storageAccess->getCommentLocationsInFile(file->getFilePath())->forEachStartTokenLocation(
[&](TokenLocation* location)
{
atomicRanges.push_back(SnippetMerger::Range(
SnippetMerger::Border(location->getLineNumber(), false),
SnippetMerger::Border(location->getOtherTokenLocation()->getLineNumber(), false)
));
}
);
atomicRanges = SnippetMerger::Range::mergeAdjacent(atomicRanges);
ranges = fileScopedMerger.merge(atomicRanges);
}
const int snippetExpandRange = ApplicationSettings::getInstance()->getCodeSnippetExpandRange();