#include "Annotations.h"
#include "Config.h"
#include "InlayHints.h"
#include "Protocol.h"
#include "TestTU.h"
#include "TestWorkspace.h"
#include "XRefs.h"
#include "support/Context.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ScopedPrinter.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <string>
#include <vector>
namespace clang {
namespace clangd {
llvm::raw_ostream &operator<<(llvm::raw_ostream &Stream,
const InlayHint &Hint) { … }
namespace {
ElementsAre;
IsEmpty;
std::vector<InlayHint> hintsOfKind(ParsedAST &AST, InlayHintKind Kind) { … }
enum HintSide { … };
struct ExpectedHint { … };
MATCHER_P2(HintMatcher, Expected, Code, llvm::to_string(Expected)) { … }
MATCHER_P(labelIs, Label, "") { … }
Config noHintsConfig() { … }
template <typename... ExpectedHints>
void assertHintsWithHeader(InlayHintKind Kind, llvm::StringRef AnnotatedSource,
llvm::StringRef HeaderContent,
ExpectedHints... Expected) { … }
template <typename... ExpectedHints>
void assertHints(InlayHintKind Kind, llvm::StringRef AnnotatedSource,
ExpectedHints... Expected) { … }
template <typename... T> void ignore(T &&...) { … }
template <typename... ExpectedHints>
void assertParameterHints(llvm::StringRef AnnotatedSource,
ExpectedHints... Expected) { … }
template <typename... ExpectedHints>
void assertTypeHints(llvm::StringRef AnnotatedSource,
ExpectedHints... Expected) { … }
template <typename... ExpectedHints>
void assertDesignatorHints(llvm::StringRef AnnotatedSource,
ExpectedHints... Expected) { … }
template <typename... ExpectedHints>
void assertBlockEndHints(llvm::StringRef AnnotatedSource,
ExpectedHints... Expected) { … }
TEST(ParameterHints, Smoke) { … }
TEST(ParameterHints, NoName) { … }
TEST(ParameterHints, NoNameConstReference) { … }
TEST(ParameterHints, NoNameReference) { … }
TEST(ParameterHints, NoNameRValueReference) { … }
TEST(ParameterHints, NoNameVariadicDeclaration) { … }
TEST(ParameterHints, NoNameVariadicForwarded) { … }
TEST(ParameterHints, NoNameVariadicPlain) { … }
TEST(ParameterHints, NameInDefinition) { … }
TEST(ParameterHints, NamePartiallyInDefinition) { … }
TEST(ParameterHints, NameInDefinitionVariadic) { … }
TEST(ParameterHints, NameMismatch) { … }
TEST(ParameterHints, NameConstReference) { … }
TEST(ParameterHints, NameTypeAliasConstReference) { … }
TEST(ParameterHints, NameReference) { … }
TEST(ParameterHints, NameTypeAliasReference) { … }
TEST(ParameterHints, NameRValueReference) { … }
TEST(ParameterHints, VariadicForwardedConstructor) { … }
TEST(ParameterHints, VariadicPlainConstructor) { … }
TEST(ParameterHints, VariadicForwardedNewConstructor) { … }
TEST(ParameterHints, VariadicPlainNewConstructor) { … }
TEST(ParameterHints, VariadicForwarded) { … }
TEST(ParameterHints, VariadicPlain) { … }
TEST(ParameterHints, VariadicPlainWithPackFirst) { … }
TEST(ParameterHints, VariadicSplitTwolevel) { … }
TEST(ParameterHints, VariadicNameFromSpecialization) { … }
TEST(ParameterHints, VariadicNameFromSpecializationRecursive) { … }
TEST(ParameterHints, VariadicOverloaded) { … }
TEST(ParameterHints, VariadicRecursive) { … }
TEST(ParameterHints, VariadicVarargs) { … }
TEST(ParameterHints, VariadicTwolevelUnresolved) { … }
TEST(ParameterHints, VariadicTwoCalls) { … }
TEST(ParameterHints, VariadicInfinite) { … }
TEST(ParameterHints, VariadicDuplicatePack) { … }
TEST(ParameterHints, VariadicEmplace) { … }
TEST(ParameterHints, VariadicReferenceHint) { … }
TEST(ParameterHints, VariadicReferenceHintForwardingRef) { … }
TEST(ParameterHints, VariadicReferenceHintForwardingRefStdForward) { … }
TEST(ParameterHints, VariadicNoReferenceHintForwardingRefStdForward) { … }
TEST(ParameterHints, VariadicNoReferenceHintUnresolvedForward) { … }
TEST(ParameterHints, MatchingNameVariadicForwarded) { … }
TEST(ParameterHints, MatchingNameVariadicPlain) { … }
TEST(ParameterHints, Operator) { … }
TEST(ParameterHints, FunctionCallOperator) { … }
TEST(ParameterHints, DeducingThis) { … }
TEST(ParameterHints, Macros) { … }
TEST(ParameterHints, ConstructorParens) { … }
TEST(ParameterHints, ConstructorBraces) { … }
TEST(ParameterHints, ConstructorStdInitList) { … }
TEST(ParameterHints, MemberInit) { … }
TEST(ParameterHints, ImplicitConstructor) { … }
TEST(ParameterHints, FunctionPointer) { … }
TEST(ParameterHints, ArgMatchesParam) { … }
TEST(ParameterHints, ArgMatchesParamReference) { … }
TEST(ParameterHints, LeadingUnderscore) { … }
TEST(ParameterHints, DependentCalls) { … }
TEST(ParameterHints, VariadicFunction) { … }
TEST(ParameterHints, VarargsFunction) { … }
TEST(ParameterHints, CopyOrMoveConstructor) { … }
TEST(ParameterHints, AggregateInit) { … }
TEST(ParameterHints, UserDefinedLiteral) { … }
TEST(ParameterHints, ParamNameComment) { … }
TEST(ParameterHints, SetterFunctions) { … }
TEST(ParameterHints, BuiltinFunctions) { … }
TEST(ParameterHints, IncludeAtNonGlobalScope) { … }
TEST(TypeHints, Smoke) { … }
TEST(TypeHints, Decorations) { … }
TEST(TypeHints, DecltypeAuto) { … }
TEST(TypeHints, NoQualifiers) { … }
TEST(TypeHints, Lambda) { … }
TEST(TypeHints, StructuredBindings_PublicStruct) { … }
TEST(TypeHints, StructuredBindings_Array) { … }
TEST(TypeHints, StructuredBindings_TupleLike) { … }
TEST(TypeHints, StructuredBindings_NoInitializer) { … }
TEST(TypeHints, InvalidType) { … }
TEST(TypeHints, ReturnTypeDeduction) { … }
TEST(TypeHints, DependentType) { … }
TEST(TypeHints, LongTypeName) { … }
TEST(TypeHints, DefaultTemplateArgs) { … }
TEST(TypeHints, Deduplication) { … }
TEST(TypeHints, SinglyInstantiatedTemplate) { … }
TEST(TypeHints, Aliased) { … }
TEST(TypeHints, Decltype) { … }
TEST(TypeHints, SubstTemplateParameterAliases) { … }
TEST(DesignatorHints, Basic) { … }
TEST(DesignatorHints, Nested) { … }
TEST(DesignatorHints, AnonymousRecord) { … }
TEST(DesignatorHints, Suppression) { … }
TEST(DesignatorHints, StdArray) { … }
TEST(DesignatorHints, OnlyAggregateInit) { … }
TEST(DesignatorHints, NoCrash) { … }
TEST(InlayHints, RestrictRange) { … }
TEST(ParameterHints, PseudoObjectExpr) { … }
TEST(ParameterHints, ArgPacksAndConstructors) { … }
TEST(ParameterHints, DoesntExpandAllArgs) { … }
TEST(BlockEndHints, Functions) { … }
TEST(BlockEndHints, Methods) { … }
TEST(BlockEndHints, Namespaces) { … }
TEST(BlockEndHints, Types) { … }
TEST(BlockEndHints, If) { … }
TEST(BlockEndHints, Loops) { … }
TEST(BlockEndHints, Switch) { … }
TEST(BlockEndHints, PrintLiterals) { … }
TEST(BlockEndHints, PrintRefs) { … }
TEST(BlockEndHints, PrintConversions) { … }
TEST(BlockEndHints, PrintOperators) { … }
TEST(BlockEndHints, TrailingSemicolon) { … }
TEST(BlockEndHints, TrailingText) { … }
TEST(BlockEndHints, Macro) { … }
TEST(BlockEndHints, PointerToMemberFunction) { … }
}
}
}