TextEditor: remove text editor action handler

Give each editor a context and register editor actions individually for
that context. This removes the need to tell the action handler the
current editor. Additionally all actions are now available in editor
widgets outside of the EditorManager.

Change-Id: I0109866b180889762f8bd8aa07874d8d7c55bfa6
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
David Schulz
2024-03-27 14:00:21 +01:00
parent c459e8d490
commit 411100b037
30 changed files with 924 additions and 955 deletions

View File

@@ -52,7 +52,6 @@
#include <texteditor/codeassist/genericproposalmodel.h>
#include <texteditor/colorpreviewhoverhandler.h>
#include <texteditor/snippets/snippetprovider.h>
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/textmark.h>
#include <utils/algorithm.h>
@@ -1169,12 +1168,12 @@ QmlJSEditorFactory::QmlJSEditorFactory(Utils::Id _id)
addHoverHandler(new ColorPreviewHoverHandler);
setCompletionAssistProvider(new QmlJSCompletionAssistProvider);
setEditorActionHandlers(TextEditorActionHandler::Format
| TextEditorActionHandler::UnCommentSelection
| TextEditorActionHandler::UnCollapseAll
| TextEditorActionHandler::FollowSymbolUnderCursor
| TextEditorActionHandler::RenameSymbol
| TextEditorActionHandler::FindUsage);
setOptionalActionMask(OptionalActions::Format
| OptionalActions::UnCommentSelection
| OptionalActions::UnCollapseAll
| OptionalActions::FollowSymbolUnderCursor
| OptionalActions::RenameSymbol
| OptionalActions::FindUsage);
}
static void decorateEditor(TextEditorWidget *editor)