Display additional command content in suggestion list

This commit is contained in:
aringenbach
2023-04-19 15:32:30 +02:00
parent d28010098a
commit 56ad4a03d3
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