mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
IDE: Add CodeCompleteInitsInPostfixExpr to completion cache key
This fixes a source of non-determinism. The IDE/complete_constructor test would sometimes fail depending on the order in which prior tests ran, since those prior tests might populate the code completion cache.
This commit is contained in:
@@ -39,13 +39,15 @@ public:
|
||||
std::vector<std::string> AccessPath;
|
||||
bool ResultsHaveLeadingDot;
|
||||
bool ForTestableLookup;
|
||||
bool CodeCompleteInitsInPostfixExpr;
|
||||
|
||||
friend bool operator==(const Key &LHS, const Key &RHS) {
|
||||
return LHS.ModuleFilename == RHS.ModuleFilename &&
|
||||
LHS.ModuleName == RHS.ModuleName &&
|
||||
LHS.AccessPath == RHS.AccessPath &&
|
||||
LHS.ResultsHaveLeadingDot == RHS.ResultsHaveLeadingDot &&
|
||||
LHS.ForTestableLookup == RHS.ForTestableLookup;
|
||||
LHS.ModuleName == RHS.ModuleName &&
|
||||
LHS.AccessPath == RHS.AccessPath &&
|
||||
LHS.ResultsHaveLeadingDot == RHS.ResultsHaveLeadingDot &&
|
||||
LHS.ForTestableLookup == RHS.ForTestableLookup &&
|
||||
LHS.CodeCompleteInitsInPostfixExpr == RHS.CodeCompleteInitsInPostfixExpr;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -101,10 +103,10 @@ template<>
|
||||
struct DenseMapInfo<swift::ide::CodeCompletionCache::Key> {
|
||||
using KeyTy = swift::ide::CodeCompletionCache::Key;
|
||||
static inline KeyTy getEmptyKey() {
|
||||
return KeyTy{"", "", {}, false, false};
|
||||
return KeyTy{"", "", {}, false, false, false};
|
||||
}
|
||||
static inline KeyTy getTombstoneKey() {
|
||||
return KeyTy{"", "", {}, true, false};
|
||||
return KeyTy{"", "", {}, true, false, false};
|
||||
}
|
||||
static unsigned getHashValue(const KeyTy &Val) {
|
||||
size_t H = 0;
|
||||
|
||||
Reference in New Issue
Block a user