void () { myEditor.getCaretModel().addCaretListener(myEditorCaretListener); myEditor.getDocument().addDocumentListener(new DocumentListener() { @Override public void documentChanged(@NotNull DocumentEvent e) { rescheduleUpdate(); } }, this); MessageBusConnection connection = myProject.getMessageBus().connect(this); connection.subscribe(ExternalParameterInfoChangesProvider.TOPIC, (e, offset) -> { if (e != null && (e != myEditor || myLbraceMarker.getStartOffset() != offset)) return; updateWhenAllCommitted(); }); EditorUtil.disposeWithEditor(myEditor, this); myProject.getMessageBus().connect(this).subscribe(DumbService.DUMB_MODE, new DumbService.DumbModeListener() { @Override public void enteredDumbMode() { updateComponent(); } @Override public void exitDumbMode() { updateComponent(); } }); }