File indexing completed on 2024-04-28 11:20:41

0001 /*
0002     SPDX-License-Identifier: GPL-2.0-or-later
0003     SPDX-FileCopyrightText: 2009 Alexander Rieder <alexanderrieder@gmail.com>
0004 */
0005 
0006 #ifndef _SAGECOMPLETIONOBJECT_H
0007 #define _SAGECOMPLETIONOBJECT_H
0008 
0009 #include "completionobject.h"
0010 #include "expression.h"
0011 
0012 class SageSession;
0013 
0014 class SageCompletionObject : public Cantor::CompletionObject
0015 {
0016   Q_OBJECT
0017   public:
0018     SageCompletionObject( const QString& command, int index, SageSession* session);
0019     ~SageCompletionObject() override;
0020 
0021   protected:
0022     bool mayIdentifierContain(QChar c) const override;
0023     bool mayIdentifierBeginWith(QChar c) const override;
0024 
0025 
0026   protected Q_SLOTS:
0027     void fetchCompletions() override;
0028     void extractCompletions();
0029     void fetchIdentifierType() override;
0030     void extractIdentifierType(Cantor::Expression::Status status);
0031 
0032  private:
0033     void extractCompletionsNew();
0034     void extractCompletionsLegacy();
0035 
0036   private:
0037     Cantor::Expression* m_expression;
0038 };
0039 
0040 #endif /* _SAGECOMPLETIONOBJECT_H */