Skip to content

Commit 7e170de

Browse files
committed
[CodeCompletion] Remove unused parameter from a couple of lambda
1 parent ecfd369 commit 7e170de

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

lib/IDE/CodeCompletion.cpp

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4030,8 +4030,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
40304030
/// Add '#file', '#line', et at.
40314031
void addPoundLiteralCompletions(bool needPound) {
40324032
auto addFromProto = [&](StringRef name, CodeCompletionKeywordKind kwKind,
4033-
CodeCompletionLiteralKind literalKind,
4034-
StringRef defaultTypeName) {
4033+
CodeCompletionLiteralKind literalKind) {
40354034
if (!needPound)
40364035
name = name.substr(1);
40374036

@@ -4045,17 +4044,17 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
40454044
};
40464045

40474046
addFromProto("#function", CodeCompletionKeywordKind::pound_function,
4048-
CodeCompletionLiteralKind::StringLiteral, "String");
4047+
CodeCompletionLiteralKind::StringLiteral);
40494048
addFromProto("#file", CodeCompletionKeywordKind::pound_file,
4050-
CodeCompletionLiteralKind::StringLiteral, "String");
4049+
CodeCompletionLiteralKind::StringLiteral);
40514050
if (Ctx.LangOpts.EnableConcisePoundFile) {
40524051
addFromProto("#filePath", CodeCompletionKeywordKind::pound_file,
4053-
CodeCompletionLiteralKind::StringLiteral, "String");
4052+
CodeCompletionLiteralKind::StringLiteral);
40544053
}
40554054
addFromProto("#line", CodeCompletionKeywordKind::pound_line,
4056-
CodeCompletionLiteralKind::IntegerLiteral, "Int");
4055+
CodeCompletionLiteralKind::IntegerLiteral);
40574056
addFromProto("#column", CodeCompletionKeywordKind::pound_column,
4058-
CodeCompletionLiteralKind::IntegerLiteral, "Int");
4057+
CodeCompletionLiteralKind::IntegerLiteral);
40594058

40604059
addKeyword(needPound ? "#dsohandle" : "dsohandle", "UnsafeRawPointer",
40614060
CodeCompletionKeywordKind::pound_dsohandle);
@@ -4065,7 +4064,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
40654064
auto &context = CurrDeclContext->getASTContext();
40664065

40674066
auto addFromProto = [&](
4068-
CodeCompletionLiteralKind kind, StringRef defaultTypeName,
4067+
CodeCompletionLiteralKind kind,
40694068
llvm::function_ref<void(CodeCompletionResultBuilder &)> consumer,
40704069
bool isKeyword = false) {
40714070

@@ -4083,29 +4082,29 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
40834082
using Builder = CodeCompletionResultBuilder;
40844083

40854084
// Add literal completions that conform to specific protocols.
4086-
addFromProto(LK::IntegerLiteral, "Int", [](Builder &builder) {
4085+
addFromProto(LK::IntegerLiteral, [](Builder &builder) {
40874086
builder.addTextChunk("0");
40884087
});
4089-
addFromProto(LK::BooleanLiteral, "Bool", [](Builder &builder) {
4088+
addFromProto(LK::BooleanLiteral, [](Builder &builder) {
40904089
builder.addBaseName("true");
40914090
}, /*isKeyword=*/true);
4092-
addFromProto(LK::BooleanLiteral, "Bool", [](Builder &builder) {
4091+
addFromProto(LK::BooleanLiteral, [](Builder &builder) {
40934092
builder.addBaseName("false");
40944093
}, /*isKeyword=*/true);
4095-
addFromProto(LK::NilLiteral, "", [](Builder &builder) {
4094+
addFromProto(LK::NilLiteral, [](Builder &builder) {
40964095
builder.addBaseName("nil");
40974096
}, /*isKeyword=*/true);
4098-
addFromProto(LK::StringLiteral, "String", [&](Builder &builder) {
4097+
addFromProto(LK::StringLiteral, [&](Builder &builder) {
40994098
builder.addTextChunk("\"");
41004099
builder.addSimpleNamedParameter("abc");
41014100
builder.addTextChunk("\"");
41024101
});
4103-
addFromProto(LK::ArrayLiteral, "Array", [&](Builder &builder) {
4102+
addFromProto(LK::ArrayLiteral, [&](Builder &builder) {
41044103
builder.addLeftBracket();
41054104
builder.addSimpleNamedParameter("values");
41064105
builder.addRightBracket();
41074106
});
4108-
addFromProto(LK::DictionaryLiteral, "Dictionary", [&](Builder &builder) {
4107+
addFromProto(LK::DictionaryLiteral, [&](Builder &builder) {
41094108
builder.addLeftBracket();
41104109
builder.addSimpleNamedParameter("key");
41114110
builder.addTextChunk(": ");
@@ -4114,7 +4113,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
41144113
});
41154114

41164115
auto floatType = context.getFloatDecl()->getDeclaredType();
4117-
addFromProto(LK::ColorLiteral, "", [&](Builder &builder) {
4116+
addFromProto(LK::ColorLiteral, [&](Builder &builder) {
41184117
builder.addBaseName("#colorLiteral");
41194118
builder.addLeftParen();
41204119
builder.addCallParameter(context.getIdentifier("red"), floatType);
@@ -4128,7 +4127,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
41284127
});
41294128

41304129
auto stringType = context.getStringDecl()->getDeclaredType();
4131-
addFromProto(LK::ImageLiteral, "", [&](Builder &builder) {
4130+
addFromProto(LK::ImageLiteral, [&](Builder &builder) {
41324131
builder.addBaseName("#imageLiteral");
41334132
builder.addLeftParen();
41344133
builder.addCallParameter(context.getIdentifier("resourceName"),

0 commit comments

Comments
 (0)