fix: Commands now completable when not starting with / (#4846)

* Add commands to completable inputs when no prefix
This commit is contained in:
Daniel Sage
2023-09-30 07:06:16 -04:00
committed by GitHub
parent bdd7d95092
commit 4d8b62364d
8 changed files with 123 additions and 84 deletions
@@ -30,7 +30,13 @@ public:
void updateResults(const QString &query, bool isFirstWord = false);
private:
enum class SourceKind { Emote, User, Command, EmoteAndUser };
enum class SourceKind {
Emote,
User,
Command,
EmoteCommand,
EmoteUserCommand
};
/// @brief Updates the internal completion source based on the current query.
/// The completion source will only change if the deduced completion kind
@@ -47,6 +53,10 @@ private:
std::unique_ptr<completion::Source> buildSource(SourceKind kind) const;
std::unique_ptr<completion::Source> buildEmoteSource() const;
std::unique_ptr<completion::Source> buildUserSource() const;
std::unique_ptr<completion::Source> buildCommandSource() const;
Channel &channel_;
std::unique_ptr<completion::Source> source_{};
std::optional<SourceKind> sourceKind_{};