[clang-tools-extra] r336330 - [NFS] Wipe trailing whitespaces
Kirill Bobyrev via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 5 02:37:27 PDT 2018
Author: omtcyfz
Date: Thu Jul 5 02:37:26 2018
New Revision: 336330
URL: http://llvm.org/viewvc/llvm-project?rev=336330&view=rev
Log:
[NFS] Wipe trailing whitespaces
This patch is a preparation for another one containing meaningful
changes. This patch simply removes trailing whitespaces in few files
affected by the upcoming patch and reformats
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=336330&r1=336329&r2=336330&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/Quality.cpp (original)
+++ clang-tools-extra/trunk/clangd/Quality.cpp Thu Jul 5 02:37:26 2018
@@ -64,7 +64,8 @@ static SymbolQualitySignals::SymbolCateg
return Switch().Visit(&ND);
}
-static SymbolQualitySignals::SymbolCategory categorize(const CodeCompletionResult &R) {
+static SymbolQualitySignals::SymbolCategory
+categorize(const CodeCompletionResult &R) {
if (R.Declaration)
return categorize(*R.Declaration);
if (R.Kind == CodeCompletionResult::RK_Macro)
@@ -72,57 +73,57 @@ static SymbolQualitySignals::SymbolCateg
// Everything else is a keyword or a pattern. Patterns are mostly keywords
// too, except a few which we recognize by cursor kind.
switch (R.CursorKind) {
- case CXCursor_CXXMethod:
- return SymbolQualitySignals::Function;
- case CXCursor_ModuleImportDecl:
- return SymbolQualitySignals::Namespace;
- case CXCursor_MacroDefinition:
- return SymbolQualitySignals::Macro;
- case CXCursor_TypeRef:
- return SymbolQualitySignals::Type;
- case CXCursor_MemberRef:
- return SymbolQualitySignals::Variable;
- default:
- return SymbolQualitySignals::Keyword;
+ case CXCursor_CXXMethod:
+ return SymbolQualitySignals::Function;
+ case CXCursor_ModuleImportDecl:
+ return SymbolQualitySignals::Namespace;
+ case CXCursor_MacroDefinition:
+ return SymbolQualitySignals::Macro;
+ case CXCursor_TypeRef:
+ return SymbolQualitySignals::Type;
+ case CXCursor_MemberRef:
+ return SymbolQualitySignals::Variable;
+ default:
+ return SymbolQualitySignals::Keyword;
}
}
static SymbolQualitySignals::SymbolCategory
categorize(const index::SymbolInfo &D) {
switch (D.Kind) {
- case index::SymbolKind::Namespace:
- case index::SymbolKind::NamespaceAlias:
- return SymbolQualitySignals::Namespace;
- case index::SymbolKind::Macro:
- return SymbolQualitySignals::Macro;
- case index::SymbolKind::Enum:
- case index::SymbolKind::Struct:
- case index::SymbolKind::Class:
- case index::SymbolKind::Protocol:
- case index::SymbolKind::Extension:
- case index::SymbolKind::Union:
- case index::SymbolKind::TypeAlias:
- return SymbolQualitySignals::Type;
- case index::SymbolKind::Function:
- case index::SymbolKind::ClassMethod:
- case index::SymbolKind::InstanceMethod:
- case index::SymbolKind::StaticMethod:
- case index::SymbolKind::InstanceProperty:
- case index::SymbolKind::ClassProperty:
- case index::SymbolKind::StaticProperty:
- case index::SymbolKind::Constructor:
- case index::SymbolKind::Destructor:
- case index::SymbolKind::ConversionFunction:
- return SymbolQualitySignals::Function;
- case index::SymbolKind::Variable:
- case index::SymbolKind::Field:
- case index::SymbolKind::EnumConstant:
- case index::SymbolKind::Parameter:
- return SymbolQualitySignals::Variable;
- case index::SymbolKind::Using:
- case index::SymbolKind::Module:
- case index::SymbolKind::Unknown:
- return SymbolQualitySignals::Unknown;
+ case index::SymbolKind::Namespace:
+ case index::SymbolKind::NamespaceAlias:
+ return SymbolQualitySignals::Namespace;
+ case index::SymbolKind::Macro:
+ return SymbolQualitySignals::Macro;
+ case index::SymbolKind::Enum:
+ case index::SymbolKind::Struct:
+ case index::SymbolKind::Class:
+ case index::SymbolKind::Protocol:
+ case index::SymbolKind::Extension:
+ case index::SymbolKind::Union:
+ case index::SymbolKind::TypeAlias:
+ return SymbolQualitySignals::Type;
+ case index::SymbolKind::Function:
+ case index::SymbolKind::ClassMethod:
+ case index::SymbolKind::InstanceMethod:
+ case index::SymbolKind::StaticMethod:
+ case index::SymbolKind::InstanceProperty:
+ case index::SymbolKind::ClassProperty:
+ case index::SymbolKind::StaticProperty:
+ case index::SymbolKind::Constructor:
+ case index::SymbolKind::Destructor:
+ case index::SymbolKind::ConversionFunction:
+ return SymbolQualitySignals::Function;
+ case index::SymbolKind::Variable:
+ case index::SymbolKind::Field:
+ case index::SymbolKind::EnumConstant:
+ case index::SymbolKind::Parameter:
+ return SymbolQualitySignals::Variable;
+ case index::SymbolKind::Using:
+ case index::SymbolKind::Module:
+ case index::SymbolKind::Unknown:
+ return SymbolQualitySignals::Unknown;
}
llvm_unreachable("Unknown index::SymbolKind");
}
@@ -160,22 +161,22 @@ float SymbolQualitySignals::evaluate() c
Score *= 0.1f;
switch (Category) {
- case Keyword: // Often relevant, but misses most signals.
- Score *= 4; // FIXME: important keywords should have specific boosts.
- break;
- case Type:
- case Function:
- case Variable:
- Score *= 1.1f;
- break;
- case Namespace:
- Score *= 0.8f;
- break;
- case Macro:
- Score *= 0.2f;
- break;
- case Unknown:
- break;
+ case Keyword: // Often relevant, but misses most signals.
+ Score *= 4; // FIXME: important keywords should have specific boosts.
+ break;
+ case Type:
+ case Function:
+ case Variable:
+ Score *= 1.1f;
+ break;
+ case Namespace:
+ Score *= 0.8f;
+ break;
+ case Macro:
+ Score *= 0.2f;
+ break;
+ case Unknown:
+ break;
}
return Score;
More information about the cfe-commits
mailing list