Skip to content

Commit 236fed2

Browse files
committed
[Test] Remove redundant signature parameter name="" in swift-ide-test
1 parent 979ccd1 commit 236fed2

6 files changed

+9
-6
lines changed

test/IDE/signature_help_closure_param.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ func apply<Value, Result>(value: Value, body: (Value) -> Result) -> Result {
55
}
66

77
// CLOSURE_PARAM: Begin signatures, 1 items
8-
// CLOSURE_PARAM-NEXT: Signature[Active]: body(<param name="" active>Value</param>) -> Result
8+
// CLOSURE_PARAM-NEXT: Signature[Active]: body(<param active>Value</param>) -> Result
99
// CLOSURE_PARAM-NEXT: End signatures

test/IDE/signature_help_currying.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func testCurryMemberFull() {
5454
}
5555

5656
// CURRY_TOPLEVEL: Begin signatures, 1 items
57-
// CURRY_TOPLEVEL-NEXT: Signature[Active]: (<param name="" active>Double</param>) -> (String) -> Void
57+
// CURRY_TOPLEVEL-NEXT: Signature[Active]: (<param active>Double</param>) -> (String) -> Void
5858
// CURRY_TOPLEVEL-NEXT: End signatures
5959

6060
// CURRY_MEMBER_PARTIAL: Begin signatures, 8 items

test/IDE/signature_help_enum_case.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ func testUnlabled() {
1919
// LABELLED-NEXT: End signatures
2020

2121
// UNLABELLED: Begin signatures, 1 items
22-
// UNLABELLED-NEXT: Signature[Active]: qrCode(<param name="" active>String</param>) -> Barcode
22+
// UNLABELLED-NEXT: Signature[Active]: qrCode(<param active>String</param>) -> Barcode
2323
// UNLABELLED-NEXT: End signatures

test/IDE/signature_help_member_closure.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ struct Observable {
99
}
1010

1111
// MEMBER_CLOSURE: Begin signatures, 1 items
12-
// MEMBER_CLOSURE-NEXT: Signature[Active]: observer(<param name="">String</param>, <param name="" active>Int?</param>, <param name="">[AnyHashable : [Double?]]</param>) async throws -> [Observable?]
12+
// MEMBER_CLOSURE-NEXT: Signature[Active]: observer(<param>String</param>, <param active>Int?</param>, <param>[AnyHashable : [Double?]]</param>) async throws -> [Observable?]
1313
// MEMBER_CLOSURE-NEXT: End signatures

test/IDE/signature_help_member_subscript.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let matrix = Matrix()
1818
matrix[#^MEMBER_SUBSCRIPT^#]
1919

2020
// MEMBER_SUBSCRIPT: Begin signatures, 4 items
21-
// MEMBER_SUBSCRIPT-NEXT: Signature[Active]: subscript(<param name="" active>keyPath: KeyPath<Matrix, Value></param>) -> Value
21+
// MEMBER_SUBSCRIPT-NEXT: Signature[Active]: subscript(<param active>keyPath: KeyPath<Matrix, Value></param>) -> Value
2222
// MEMBER_SUBSCRIPT-NEXT: Signature: subscript(<param name="row" active>row: Int</param>, <param name="column">column: Int</param>) -> Int
2323
// MEMBER_SUBSCRIPT-NEXT: Signature: subscript(<param name="r" active>row: Int</param>) -> [Int]
2424
// MEMBER_SUBSCRIPT-NEXT: Signature: subscript(<param name="c" active>column: Int</param>) -> [Int]

tools/swift-ide-test/swift-ide-test.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1501,7 +1501,10 @@ static void printSignatureHelpResultsImpl(const FormattedSignatureHelp &Result,
15011501
Param.Offset - currentPos);
15021502
}
15031503

1504-
signatureOS << "<param name=\"" << Param.Name << "\"";
1504+
signatureOS << "<param";
1505+
if (!Param.Name.empty()) {
1506+
signatureOS << " name=\"" << Param.Name << '"';
1507+
}
15051508
if (Signature.ActiveParam && *Signature.ActiveParam == j) {
15061509
signatureOS << " active";
15071510
}

0 commit comments

Comments
 (0)