Display additional command content in suggestion list

This commit is contained in:
aringenbach
2023-04-19 15:32:30 +02:00
parent 0e7d802920
commit 4d7a502903
7 changed files with 70 additions and 24 deletions
@@ -25,7 +25,9 @@ struct RoomMembersProviderMember {
}
struct CommandsProviderCommand {
var name: String
let name: String
let parametersFormat: String
let description: String
}
class CompletionSuggestionUserID: NSObject {
@@ -50,6 +52,8 @@ struct CompletionSuggestionServiceUserItem: CompletionSuggestionUserItemProtocol
struct CompletionSuggestionServiceCommandItem: CompletionSuggestionCommandItemProtocol {
let name: String
let parametersFormat: String
let description: String
}
class CompletionSuggestionService: CompletionSuggestionServiceProtocol {
@@ -165,7 +169,7 @@ class CompletionSuggestionService: CompletionSuggestionServiceProtocol {
guard let self else { return }
self.suggestionItems = commands.map { command in
CompletionSuggestionItem.command(value: CompletionSuggestionServiceCommandItem(name: command.name))
CompletionSuggestionItem.command(value: CompletionSuggestionServiceCommandItem(name: command.name, parametersFormat: command.parametersFormat, description: command.description))
}
self.items.send(self.suggestionItems.filter { item in
@@ -26,6 +26,8 @@ protocol CompletionSuggestionUserItemProtocol: Avatarable {
protocol CompletionSuggestionCommandItemProtocol {
var name: String { get }
var parametersFormat: String { get }
var description: String { get }
}
enum CompletionSuggestionItem {