Skip to content

Commit 58424fc

Browse files
committed
Update documentSymbols to always return a children array
This fixes the document symbol test.
1 parent 31ac0bc commit 58424fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/SourceKitLSP/Swift/SwiftLanguageServer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,11 +669,11 @@ extension SwiftLanguageServer {
669669
selectionRange = range
670670
}
671671

672-
let children: [DocumentSymbol]?
672+
let children: [DocumentSymbol]
673673
if let substructure: SKDResponseArray = value[self.keys.substructure] {
674674
children = documentSymbols(array: substructure)
675675
} else {
676-
children = nil
676+
children = []
677677
}
678678
return DocumentSymbol(name: name,
679679
detail: nil,

0 commit comments

Comments
 (0)