Skip to content

Commit 118e7b3

Browse files
committed
Tweak tab to accept
1 parent b031405 commit 118e7b3

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Core/Sources/KeyBindingManager/TabToAcceptSuggestion.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ final class TabToAcceptSuggestion {
188188
}
189189
guard let presentingSuggestion = filespace.presentingSuggestion
190190
else {
191-
Logger.service.info("TabToAcceptSuggestion: No Suggestions found")
191+
Logger.service.info(
192+
"TabToAcceptSuggestion: No presenting found for \(filespace.fileURL.lastPathComponent), found \(filespace.suggestions.count) suggestion, index \(filespace.suggestionIndex)."
193+
)
192194
return .unchanged
193195
}
194196

Tool/Sources/Workspace/Filespace.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ public final class Filespace: @unchecked Sendable {
8888
}
8989

9090
public var presentingSuggestion: CodeSuggestion? {
91-
guard suggestions.endIndex > suggestionIndex, suggestionIndex >= 0 else { return nil }
91+
guard suggestions.endIndex > suggestionIndex, suggestionIndex >= 0 else {
92+
if suggestions.isEmpty {
93+
return nil
94+
}
95+
return suggestions.first
96+
}
9297
return suggestions[suggestionIndex]
9398
}
9499

0 commit comments

Comments
 (0)