How do I listen for active editor?

You can get information like the path of the currently open file in the editor, but what if you want to listen for open files in the editor? I want to do something when I open another file.

@Dennis thank you for the discussion, you can use the EditorManager (frontend) which has this information. It exposes events such as onActiveEditorChanged.