Use reflection script for autocomplete and help in python shell

* Also add syntax checking via parse attempts.
This commit is contained in:
baldurk
2026-08-13 17:46:43 +01:00
parent 2aff86b678
commit 88782bea97
4 changed files with 622 additions and 106 deletions
+23 -1
View File
@@ -32,6 +32,8 @@ class PythonContext;
class QTextEdit;
class RDToolTip;
class QTimer;
class QCompleter;
class QStringListModel;
namespace Ui
{
@@ -117,6 +119,7 @@ private slots:
void extensionLoaded(const QString &extension);
void editor_contextMenu(const QPoint &pos);
void editorTab_Changed(int index);
void doSyntaxCheck();
private:
Ui::PythonShell *ui;
@@ -125,9 +128,21 @@ private:
ScintillaEdit *runningScriptEditor = NULL;
RDToolTip *m_ToolTip;
bool m_FuncTip = false;
intptr_t m_FuncTipLine = 0;
bool m_ContextMenuVisible = false;
bool m_HelpPrinting = false;
QTimer *m_SyntaxCheckTimer;
QCompleter *m_InteractiveCompleter;
QStringListModel *m_InteractiveCompletionModel;
int m_InteractiveCompletionPrefix = 0;
static const int CURRENT_MARKER = 0;
PythonContext *interactiveContext = NULL, *scriptContext = NULL;
PythonContext *interactiveContext = NULL, *scriptContext = NULL, *completionContext = NULL;
QList<QString> history;
int historyidx = -1;
@@ -150,6 +165,8 @@ private:
ScintillaEdit *makeEditor();
void updateEditorCloseButton();
bool eventFilter(QObject *watched, QEvent *event) override;
void updateScriptOutput(bool fullRefresh);
PythonContext *newContext();
@@ -157,6 +174,11 @@ private:
void runScript(bool debugging);
void doAutocomplete(ScintillaEdit *editor);
void doFunccomplete(ScintillaEdit *editor);
void hideFunccompleteTooltip();
void selectedHelp(QString word);
void refreshCurrentHelp();