clang-tools 10.0.0

Public Types | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
clang::clangd::TweakTest Class Reference

`#include <TweakTesting.h>`

Inheritance diagram for clang::clangd::TweakTest:
[legend]
Collaboration diagram for clang::clangd::TweakTest:
[legend]

## Public Types
enum | CodeContext { File, Function, Expression }

## Public Attributes
llvm::StringMap< std::string > | ExtraFiles

## Protected Member Functions
| TweakTest (const char *TweakID)
std::string | apply (llvm::StringRef MarkedCode, llvm::StringMap< std::string > *EditedFiles=nullptr) const
::testing::Matcher< llvm::StringRef > | isAvailable () const

## Static Protected Member Functions
static std::vector< std::string > | expandCases (llvm::StringRef MarkedCode)

## Protected Attributes
std::string | Header
llvm::StringRef | FileName = "TestTU.cpp"
std::vector< const char * > | ExtraArgs
CodeContext | Context = File
std::unique_ptr< const SymbolIndex > | Index = nullptr

## Detailed Description

Definition at line 40 of file TweakTesting.h.

## Member Enumeration Documentation

## ◆ CodeContext

enum clang::clangd::TweakTest::CodeContext

Enumerator
File |
Function |
Expression |

Definition at line 46 of file TweakTesting.h.

## Constructor & Destructor Documentation

## ◆ TweakTest()

clang::clangd::TweakTest::TweakTest | ( | const char * | TweakID | ) |
| inline protected

Definition at line 59 of file TweakTesting.h.

## Member Function Documentation

## ◆ apply()

std::string clang::clangd::TweakTest::apply | ( | llvm::StringRef | MarkedCode,
|  | llvm::StringMap< std::string > * | EditedFiles = `nullptr`
| ) |  | const
| protected

Definition at line 89 of file TweakTesting.cpp.

References clang::clangd::TestTU::AdditionalFiles, clang::clangd::AST, clang::clangd::TestTU::build(), clang::clangd::TestTU::Code, clang::clangd::TestTU::ExtraArgs, ExtraArgs, ExtraFiles, clang::clangd::TestTU::Filename, FileName, Header, clang::clangd::TestTU::HeaderCode, Index, clang::clangd::prepareTweak(), and clang::clangd::detail::wrap().

## ◆ expandCases()

std::vector< std::string > clang::clangd::TweakTest::expandCases | ( | llvm::StringRef | MarkedCode | ) |
| static protected

Definition at line 141 of file TweakTesting.cpp.

References Code, Offset, clang::clangd::Annotations::points(), clang::clangd::positionToOffset(), and clang::clangd::Annotations::ranges().

## ◆ isAvailable()

testing::Matcher< llvm::StringRef > clang::clangd::TweakTest::isAvailable | ( |  | ) | const
| protected

Definition at line 136 of file TweakTesting.cpp.

References ExtraArgs, ExtraFiles, FileName, Header, and Index.

## Member Data Documentation

## ◆ Context

CodeContext clang::clangd::TweakTest::Context = File
| protected

Definition at line 72 of file TweakTesting.h.

## ◆ ExtraArgs

std::vector<const char *> clang::clangd::TweakTest::ExtraArgs
| protected

Definition at line 69 of file TweakTesting.h.

Referenced by apply(), and isAvailable().

## ◆ ExtraFiles

llvm::StringMap<std::string> clang::clangd::TweakTest::ExtraFiles

Definition at line 56 of file TweakTesting.h.

Referenced by apply(), and isAvailable().

## ◆ FileName

llvm::StringRef clang::clangd::TweakTest::FileName = "TestTU.cpp"
| protected

Definition at line 66 of file TweakTesting.h.

Referenced by apply(), and isAvailable().

## ◆ Header

std::string clang::clangd::TweakTest::Header
| protected

Definition at line 64 of file TweakTesting.h.

Referenced by apply(), and isAvailable().

## ◆ Index

std::unique_ptr<const SymbolIndex> clang::clangd::TweakTest::Index = nullptr
| protected

Definition at line 75 of file TweakTesting.h.

Referenced by apply(), and isAvailable().

The documentation for this class was generated from the following files:

- TweakTesting.h
- TweakTesting.cpp