Add a new completion API for experimental plugins feature. (#5000)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
Mm2PL
2023-12-10 14:41:05 +01:00
committed by GitHub
parent e4258160cd
commit fd4cac2c2c
13 changed files with 448 additions and 16 deletions
+3 -2
View File
@@ -170,8 +170,9 @@ void ResizingTextEdit::keyPressEvent(QKeyEvent *event)
// First type pressing tab after modifying a message, we refresh our
// completion model
this->completer_->setModel(completionModel);
completionModel->updateResults(currentCompletion,
this->isFirstWord());
completionModel->updateResults(
currentCompletion, this->toPlainText(),
this->textCursor().position(), this->isFirstWord());
this->completionInProgress_ = true;
{
// this blocks cursor movement events from resetting tab completion
+10
View File
@@ -108,6 +108,16 @@ void PluginsPage::rebuildContent()
warningLabel->setStyleSheet("color: #f00");
pluginEntry->addRow(warningLabel);
}
if (!plugin->error().isNull())
{
auto *errorLabel =
new QLabel("There was an error while loading this plugin: " +
plugin->error(),
this->dataFrame_);
errorLabel->setStyleSheet("color: #f00");
errorLabel->setWordWrap(true);
pluginEntry->addRow(errorLabel);
}
auto *description =
new QLabel(plugin->meta.description, this->dataFrame_);