Clang: Add locator specific methods to SymbolQuery

... and implement LocatorFilter using these methods.

Change-Id: Ie3e3ebb3a547e2b2bda49e76a199a3ccd8fe6403
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Ivan Donchevskii
2017-11-24 16:03:07 +01:00
parent 92cdfc0c2a
commit 88c3e27722
22 changed files with 580 additions and 25 deletions

View File

@@ -27,15 +27,34 @@
#include "sourcelocations.h"
#include "class.h"
#include "enum.h"
#include "function.h"
#include "symbol.h"
#include <cpptools/usages.h>
namespace ClangRefactoring {
enum class SymbolType
{
Class = 0,
Enum = 1
};
class SymbolQueryInterface
{
public:
virtual SourceLocations locationsAt(ClangBackEnd::FilePathId filePathId, int line, int utf8Column) const = 0;
virtual CppTools::Usages sourceUsagesAt(ClangBackEnd::FilePathId filePathId, int line, int utf8Column) const = 0;
virtual ~SymbolQueryInterface() {}
virtual SourceLocations locationsAt(ClangBackEnd::FilePathId filePathId,
int line,
int utf8Column) const = 0;
virtual CppTools::Usages sourceUsagesAt(ClangBackEnd::FilePathId filePathId,
int line,
int utf8Column) const = 0;
virtual Symbols symbolsContaining(SymbolType symbolType,
Utils::SmallStringView regularExpression) const = 0;
virtual Functions functionsContaining(Utils::SmallStringView regularExpression) const = 0;
};
} // namespace ClangRefactoring