[clang-tools-extra] r362686 - [clangd] Remove unused signature help quality signal. NFC
Ilya Biryukov via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 6 01:32:25 PDT 2019
Author: ibiryukov
Date: Thu Jun 6 01:32:25 2019
New Revision: 362686
URL: http://llvm.org/viewvc/llvm-project?rev=362686&view=rev
Log:
[clangd] Remove unused signature help quality signal. NFC
ContainsActiveParameter is not used anywhere, set incorrectly (see the
removed FIXME) and has no unit tests.
Removing it to simplify the code.
Modified:
clang-tools-extra/trunk/clangd/CodeComplete.cpp
clang-tools-extra/trunk/clangd/Quality.cpp
clang-tools-extra/trunk/clangd/Quality.h
Modified: clang-tools-extra/trunk/clangd/CodeComplete.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/CodeComplete.cpp?rev=362686&r1=362685&r2=362686&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/CodeComplete.cpp (original)
+++ clang-tools-extra/trunk/clangd/CodeComplete.cpp Thu Jun 6 01:32:25 2019
@@ -906,8 +906,7 @@ public:
private:
void processParameterChunk(llvm::StringRef ChunkText,
- SignatureInformation &Signature,
- SignatureQualitySignals Signal) const {
+ SignatureInformation &Signature) const {
// (!) this is O(n), should still be fast compared to building ASTs.
unsigned ParamStartOffset = lspLength(Signature.label);
unsigned ParamEndOffset = ParamStartOffset + lspLength(ChunkText);
@@ -921,8 +920,6 @@ private:
Info.labelString = ChunkText;
Signature.parameters.push_back(std::move(Info));
- // FIXME: this should only be set on CK_CurrentParameter.
- Signal.ContainsActiveParameter = true;
}
void processOptionalChunk(const CodeCompletionString &CCS,
@@ -939,7 +936,7 @@ private:
break;
case CodeCompletionString::CK_CurrentParameter:
case CodeCompletionString::CK_Placeholder:
- processParameterChunk(Chunk.Text, Signature, Signal);
+ processParameterChunk(Chunk.Text, Signature);
Signal.NumberOfOptionalParameters++;
break;
default:
@@ -971,7 +968,7 @@ private:
break;
case CodeCompletionString::CK_CurrentParameter:
case CodeCompletionString::CK_Placeholder:
- processParameterChunk(Chunk.Text, Signature, Signal);
+ processParameterChunk(Chunk.Text, Signature);
Signal.NumberOfParameters++;
break;
case CodeCompletionString::CK_Optional: {
Modified: clang-tools-extra/trunk/clangd/Quality.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/Quality.cpp?rev=362686&r1=362685&r2=362686&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/Quality.cpp (original)
+++ clang-tools-extra/trunk/clangd/Quality.cpp Thu Jun 6 01:32:25 2019
@@ -497,8 +497,6 @@ llvm::raw_ostream &operator<<(llvm::raw_
OS << llvm::formatv("\tNumber of parameters: {0}\n", S.NumberOfParameters);
OS << llvm::formatv("\tNumber of optional parameters: {0}\n",
S.NumberOfOptionalParameters);
- OS << llvm::formatv("\tContains active parameter: {0}\n",
- S.ContainsActiveParameter);
OS << llvm::formatv("\tKind: {0}\n", S.Kind);
return OS;
}
Modified: clang-tools-extra/trunk/clangd/Quality.h
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/Quality.h?rev=362686&r1=362685&r2=362686&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/Quality.h (original)
+++ clang-tools-extra/trunk/clangd/Quality.h Thu Jun 6 01:32:25 2019
@@ -195,7 +195,6 @@ std::string sortText(float Score, llvm::
struct SignatureQualitySignals {
uint32_t NumberOfParameters = 0;
uint32_t NumberOfOptionalParameters = 0;
- bool ContainsActiveParameter = false;
CodeCompleteConsumer::OverloadCandidate::CandidateKind Kind =
CodeCompleteConsumer::OverloadCandidate::CandidateKind::CK_Function;
};
More information about the cfe-commits
mailing list