File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1443,6 +1443,23 @@ final class SwiftCompletionTests: XCTestCase {
14431443 )
14441444 XCTAssert ( completions. items. contains ( where: { $0. label. contains ( " myFancyFunction " ) } ) )
14451445 }
1446+
1447+ func testSubscriptCompletions( ) async throws {
1448+ let testClient = try await TestSourceKitLSPClient ( )
1449+ let uri = DocumentURI ( for: . swift)
1450+ let positions = testClient. openDocument (
1451+ """
1452+ func foo(x: [Int: Int]) {
1453+ x[1️⃣
1454+ }
1455+ """ ,
1456+ uri: uri
1457+ )
1458+ let completions = try await testClient. send (
1459+ CompletionRequest ( textDocument: TextDocumentIdentifier ( uri) , position: positions [ " 1️⃣ " ] )
1460+ )
1461+ assertContains ( completions. items. map ( \. label) , " [key: Int, default: Int] " )
1462+ }
14461463}
14471464
14481465private func countFs( _ response: CompletionList ) -> Int {
You can’t perform that action at this time.
0 commit comments