regiserWorkspaceListener_(workspace) {
      const workspaceListener = this.workspaceListeners[workspace.id];

      if (!workspaceListener) {
        this.workspaceListeners[workspace.id] = workspace.addChangeListener(
          (event) => {
            const blockIds = event.ids;
            if (event.type === Blockly.Events.DELETE) {
              for (let i = 0; i < blockIds.length; i++) {
                const blockId = blockIds[i];
                if (this.blockToDebugger[blockId]) {
                  delete this.blockToDebugger[blockId];
                }
              }
            }
          },
        );
      }
    }
Adds a change listener to the given workspace to remove the reference to
the block's debugger when a block is deleted.
@param {Blockly.WorkspaceSvg} workspace The workspace to add the change
    listener to.
@private