[clang-tools-extra] r334032 - [clangd] Quality fixes (uninit var, missing debug output, pattern decl CCRs).
Sam McCall via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 5 10:58:12 PDT 2018
Author: sammccall
Date: Tue Jun 5 10:58:12 2018
New Revision: 334032
URL: http://llvm.org/viewvc/llvm-project?rev=334032&view=rev
Log:
[clangd] Quality fixes (uninit var, missing debug output, pattern decl CCRs).
Modified:
clang-tools-extra/trunk/clangd/Quality.cpp
Modified: clang-tools-extra/trunk/clangd/Quality.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/Quality.cpp?rev=334032&r1=334031&r2=334032&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/Quality.cpp (original)
+++ clang-tools-extra/trunk/clangd/Quality.cpp Tue Jun 5 10:58:12 2018
@@ -69,7 +69,7 @@ raw_ostream &operator<<(raw_ostream &OS,
static SymbolRelevanceSignals::AccessibleScope
ComputeScope(const NamedDecl &D) {
- bool InClass;
+ bool InClass = true;
for (const DeclContext *DC = D.getDeclContext(); !DC->isFileContext();
DC = DC->getParent()) {
if (DC->isFunctionOrMethod())
@@ -103,7 +103,7 @@ void SymbolRelevanceSignals::merge(const
}
// Declarations are scoped, others (like macros) are assumed global.
- if (SemaCCResult.Kind == CodeCompletionResult::RK_Declaration)
+ if (SemaCCResult.Declaration)
Scope = std::min(Scope, ComputeScope(*SemaCCResult.Declaration));
}
@@ -142,6 +142,9 @@ raw_ostream &operator<<(raw_ostream &OS,
OS << formatv("=== Symbol relevance: {0}\n", S.evaluate());
OS << formatv("\tName match: {0}\n", S.NameMatch);
OS << formatv("\tForbidden: {0}\n", S.Forbidden);
+ OS << formatv("\tProximity: {0}\n", S.ProximityScore);
+ OS << formatv("\tQuery type: {0}\n", static_cast<int>(S.Query));
+ OS << formatv("\tScope: {0}\n", static_cast<int>(S.Scope));
return OS;
}
More information about the cfe-commits
mailing list