Skip to content

clang: Workaround for empty problem ranges at start of document

Sometimes, for some reason we seem to get wrong problem ranges from libclang that start and end on the first character of the document. As a result, the final range computed for the ClangProblem will wrongly start from the beginning of the document and extend until the actual location of the problem. This commit introduces a workaround which discards the problematic problem ranges. Not sure whether this is a good solution though.

The symptom of the bug is that KDevelop highlights the whole range from the start of the document until the actual location of the problem as an error. Unfortunately, I don't know why this happens and how to reproduce it with a minimal example. It happened in one of my projects.

Edited by Thomas Schöps

Merge request reports