Files
blockly/core/renderers/common/debug.ts
T
Christopher Allen b0475b0c68 chore: Fix whitespace (#6243)
* fix: Remove spurious blank lines

  Remove extraneous blank lines introduced by deletion of
  'use strict'; pragmas.

  Also fix the location of the goog.declareModuleId call in
  core/utils/array.ts.

* fix: Add missing double-blank-line before body of modules

  Our convention is to have two blank lines between the imports (or
  module ID, if there are no imports) and the beginning of the body
  of the module.  Enforce this.

* fix: one addition format error for PR #6243
2022-06-24 19:33:39 +01:00

59 lines
1.7 KiB
TypeScript

/**
* @license
* Copyright 2021 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview Block rendering debugging functionality.
*/
/**
* Block rendering debugging functionality.
* @namespace Blockly.blockRendering.debug
*/
import * as goog from '../../../closure/goog/goog.js';
goog.declareModuleId('Blockly.blockRendering.debug');
import * as deprecation from '../../utils/deprecation.js';
/** Whether or not the debugger is turned on. */
let useDebugger = false;
/**
* Returns whether the debugger is turned on.
* @return Whether the debugger is turned on.
* @alias Blockly.blockRendering.debug.isDebuggerEnabled
*/
export function isDebuggerEnabled(): boolean {
return useDebugger;
}
/**
* Turn on the blocks debugger.
* @alias Blockly.blockRendering.debug.startDebugger
* @deprecated March 2022. Use the rendering debugger in @blockly/dev-tools.
* See https://www.npmjs.com/package/@blockly/dev-tools for more information.
*/
export function startDebugger() {
deprecation.warn(
'Blockly.blockRendering.debug.startDebugger()', 'February 2022',
'September 2022',
'the debug renderer in @blockly/dev-tools (See https://www.npmjs.com/package/@blockly/dev-tools.)');
useDebugger = true;
}
/**
* Turn off the blocks debugger.
* @alias Blockly.blockRendering.debug.stopDebugger
* @deprecated March 2022. Use the rendering debugger in @blockly/dev-tools.
* See https://www.npmjs.com/package/@blockly/dev-tools for more information.
*/
export function stopDebugger() {
deprecation.warn(
'Blockly.blockRendering.debug.stopDebugger()', 'February 2022',
'September 2022',
'the debug renderer in @blockly/dev-tools (See https://www.npmjs.com/package/@blockly/dev-tools.)');
useDebugger = false;
}