private @Nullable ClientState getClientState(@Nullable FileEditor editor) {
    ClientState state = getClientState();
    if (myProject == null || editor == null) return state;

    try (AccessToken ignored = ClientId.withClientId(ClientFileEditorManager.getClientId(editor))) {
      ClientState editorState = getClientState();
      LOG.assertTrue(state == editorState,
                     "Using editor belonging to '" + (editorState != null ? editorState.myClientId.getValue() : "null") +
                     "' under '" + (state != null ? state.myClientId.getValue() : "null") + "'");
    }

    return state;
  }
private @Nullable ClientState getClientState(@Nullable FileEditor editor)