I believe this is the correct conversion of CXSourceRange objects that are passed to libclang API and we should use it consistently everywhere. If it turns out that CXSourceRange objects can have multiple different semantics we should definitely introduce one type per semantic and fix libclang API to be type safe.
However, that is a bigger task and given the downsides (necessity to pass CXTranslationUnit everywhere, potential performance impact of the tokenization) we might end up with a completely different solution.
For context - test proposals + discussion:
https://reviews.llvm.org/D86840
"SourceRange" -> "CharSourceRange"