From 54eeb3f40ab1f68619083cfce3e0dff2521b7cef Mon Sep 17 00:00:00 2001 From: Ilya Biryukov Date: Thu, 6 Jun 2019 08:32:25 +0000 Subject: [PATCH] [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. llvm-svn: 362686 --- clang-tools-extra/clangd/CodeComplete.cpp | 9 +++------ clang-tools-extra/clangd/Quality.cpp | 2 -- clang-tools-extra/clangd/Quality.h | 1 - 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/clang-tools-extra/clangd/CodeComplete.cpp b/clang-tools-extra/clangd/CodeComplete.cpp index 32fdccc..208376a 100644 --- a/clang-tools-extra/clangd/CodeComplete.cpp +++ b/clang-tools-extra/clangd/CodeComplete.cpp @@ -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: { diff --git a/clang-tools-extra/clangd/Quality.cpp b/clang-tools-extra/clangd/Quality.cpp index 6307006..6ab0529 100644 --- a/clang-tools-extra/clangd/Quality.cpp +++ b/clang-tools-extra/clangd/Quality.cpp @@ -497,8 +497,6 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, 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; } diff --git a/clang-tools-extra/clangd/Quality.h b/clang-tools-extra/clangd/Quality.h index b358a91..54aa7cd 100644 --- a/clang-tools-extra/clangd/Quality.h +++ b/clang-tools-extra/clangd/Quality.h @@ -195,7 +195,6 @@ std::string sortText(float Score, llvm::StringRef Tiebreak = ""); struct SignatureQualitySignals { uint32_t NumberOfParameters = 0; uint32_t NumberOfOptionalParameters = 0; - bool ContainsActiveParameter = false; CodeCompleteConsumer::OverloadCandidate::CandidateKind Kind = CodeCompleteConsumer::OverloadCandidate::CandidateKind::CK_Function; }; -- 2.7.4