forked from qt-creator/qt-creator
Clang: Provide highlighting for identifier under cursor
Change-Id: I80ffe23cbcc84ab7323124581d9dd6afbe974fd0 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -29,6 +29,8 @@
|
||||
|
||||
#include <ostream>
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
namespace ClangBackEnd {
|
||||
|
||||
SourceRange::SourceRange()
|
||||
@@ -61,6 +63,17 @@ SourceLocation SourceRange::end() const
|
||||
return SourceLocation(clang_getRangeEnd(cxSourceRange));
|
||||
}
|
||||
|
||||
bool SourceRange::contains(unsigned line, unsigned column) const
|
||||
{
|
||||
const SourceLocation start_ = start();
|
||||
const SourceLocation end_ = end();
|
||||
|
||||
return start_.line() <= line
|
||||
&& start_.column() <= column
|
||||
&& line <= end_.line()
|
||||
&& column <= end_.column();
|
||||
}
|
||||
|
||||
SourceRangeContainer SourceRange::toSourceRangeContainer() const
|
||||
{
|
||||
return SourceRangeContainer(start().toSourceLocationContainer(),
|
||||
|
||||
Reference in New Issue
Block a user