void (@NotNull Editor editor, int rangeStart, int rangeEnd, int tabOutOffset) { ApplicationManager.getApplication().assertWriteAccessAllowed(); if (editor.isDisposed()) throw new IllegalArgumentException(editor + " is already disposed"); if (rangeStart > rangeEnd) { final String message = String.format("regionEnd (%d) should be larger than regionStart (%d)", rangeEnd, rangeStart); throw new IllegalArgumentException(message); } if (tabOutOffset <= rangeEnd) { final String message = String.format("tabOutOffset (%d) should be larger than rangeEnd (%d)", tabOutOffset, rangeEnd); throw new IllegalArgumentException(message); } if (!CodeInsightSettings.getInstance().TAB_EXITS_BRACKETS_AND_QUOTES) return; if (editor instanceof EditorWindow) { DocumentWindow documentWindow = ((EditorWindow)editor).getDocument(); rangeStart = documentWindow.injectedToHost(rangeStart); rangeEnd = documentWindow.injectedToHost(rangeEnd); tabOutOffset = documentWindow.injectedToHost(tabOutOffset); editor = ((EditorWindow)editor).getDelegate(); } if (!(editor instanceof EditorImpl)) return; Tracker tracker = Tracker.forEditor((EditorImpl)editor, true); tracker.registerScope(rangeStart, rangeEnd, tabOutOffset - rangeEnd); }