File indexing completed on 2024-04-28 15:53:09

0001 /*
0002     SPDX-FileCopyrightText: 2011 Sven Brauch <svenbrauch@googlemail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef PYTHONCODECOMPLETIONMODEL_H
0008 #define PYTHONCODECOMPLETIONMODEL_H
0009 #include "pythoncompletionexport.h"
0010 
0011 #include <language/codecompletion/codecompletionmodel.h>
0012 #include <language/duchain/duchainpointer.h>
0013 
0014 
0015 namespace Python {
0016 
0017 class KDEVPYTHONCOMPLETION_EXPORT PythonCodeCompletionModel : public KDevelop::CodeCompletionModel
0018 {
0019     Q_OBJECT
0020 
0021 public:
0022     PythonCodeCompletionModel(QObject* parent);
0023     ~PythonCodeCompletionModel() override;
0024     
0025     KDevelop::CodeCompletionWorker* createCompletionWorker() override;
0026     KTextEditor::Range completionRange(KTextEditor::View* view, const KTextEditor::Cursor &position) override;
0027     bool shouldStartCompletion(KTextEditor::View* view, const QString& inserted,
0028                                bool userInsertion, const KTextEditor::Cursor& position) override;
0029     bool shouldAbortCompletion(KTextEditor::View* view, const KTextEditor::Range& range, const QString& currentCompletion) override;
0030     QString filterString(KTextEditor::View *view, const KTextEditor::Range &range, const KTextEditor::Cursor &position) override;
0031 
0032     QUrl m_currentDocument;
0033 };
0034 
0035 }
0036 
0037 #endif // PYTHONCODECOMPLETIONMODEL_H