TextEditor: Get rid of extra indent ranges in RefactoringFile

Having extra indent regions complicates the interface, the
implementation and the calling code.
Instead, derive the indent regions from the change set and let callers
opt out for the relatively few cases where indentation is not desired.

Change-Id: I49d2854830a51778534ef260fb5c9f2c7685554a
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2023-11-20 11:28:41 +01:00
parent 2bd02671d8
commit 240748c106
18 changed files with 120 additions and 272 deletions

View File

@@ -55,11 +55,7 @@ private:
explicit CppRefactoringFile(TextEditor::TextEditorWidget *editor);
void fileChanged() override;
void indentSelection(const QTextCursor &selection,
const TextEditor::TextDocument *textDocument) const override;
virtual void reindentSelection(const QTextCursor &selection,
const TextEditor::TextDocument *textDocument) const override;
Utils::Id indenterId() const override;
int tokenIndexForPosition(const std::vector<CPlusPlus::Token> &tokens, int pos,
int startIndex) const;