Make the QuickFixOperation interface more useful.

* Rename cursor(unsigned/AST*) to selectToken and selectNode.
  These return a cursor that has the given token or AST node selected.
* Rename getTokenStart/EndPosition to tokenStart/EndPosition.
  Instead of returning line and column numbers, return a position
  usable with text cursors.
* Remove moveAtStart/EndOfToken.

Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
Christian Kamm
2009-11-18 11:28:06 +01:00
parent fd17d2f98f
commit e2ef1d8298
2 changed files with 23 additions and 52 deletions

View File

@@ -70,16 +70,11 @@ public:
protected:
const CPlusPlus::Token &tokenAt(unsigned index) const;
void getTokenStartPosition(unsigned index, unsigned *line,
unsigned *column) const;
void getTokenEndPosition(unsigned index, unsigned *line,
unsigned *column) const;
int tokenStartPosition(unsigned index) const;
int tokenEndPosition(unsigned index) const;
QTextCursor cursor(unsigned index) const;
QTextCursor cursor(CPlusPlus::AST *ast) const;
QTextCursor moveAtStartOfToken(unsigned index) const;
QTextCursor moveAtEndOfToken(unsigned index) const;
QTextCursor selectToken(unsigned index) const;
QTextCursor selectNode(CPlusPlus::AST *ast) const;
private:
CPlusPlus::Document::Ptr _doc;