fix(generators): Improve consistency of migrated language generators (#7662)

* docs(generators): @fileoverview -> @file; delete @suppress

* fix(generators): Fix return type of getAdjusted

  And improve its documentation too.

  Fix the @returns doc for PythonGenerator's getAdjustedInt but
  (for now) don't change the type because it does actually
  return numbers in some circumstances.
This commit is contained in:
Christopher Allen
2023-11-28 16:57:31 +00:00
committed by GitHub
parent ac362fd57a
commit b198e2f4ae
33 changed files with 41 additions and 43 deletions

View File

@@ -5,7 +5,7 @@
*/
/**
* @fileoverview Generating JavaScript for colour blocks.
* @file Generating JavaScript for colour blocks.
*/
// Former goog.module ID: Blockly.JavaScript.colour

View File

@@ -295,7 +295,7 @@ export class JavascriptGenerator extends CodeGenerator {
* @param delta Value to add.
* @param negate Whether to negate the value.
* @param order The highest order acting on this value.
* @returns The adjusted value.
* @returns The adjusted value or code that evaluates to it.
*/
getAdjusted(
block: Block,
@@ -303,7 +303,7 @@ export class JavascriptGenerator extends CodeGenerator {
delta = 0,
negate = false,
order = Order.NONE,
): string | number {
): string {
if (block.workspace.options.oneBasedIndex) {
delta--;
}

View File

@@ -5,8 +5,7 @@
*/
/**
* @fileoverview Generating JavaScript for list blocks.
* @suppress {missingRequire}
* @file Generating JavaScript for list blocks.
*/
// Former goog.module ID: Blockly.JavaScript.lists

View File

@@ -5,7 +5,7 @@
*/
/**
* @fileoverview Generating JavaScript for logic blocks.
* @file Generating JavaScript for logic blocks.
*/
// Former goog.module ID: Blockly.JavaScript.logic

View File

@@ -5,7 +5,7 @@
*/
/**
* @fileoverview Generating JavaScript for loop blocks.
* @file Generating JavaScript for loop blocks.
*/
// Former goog.module ID: Blockly.JavaScript.loops

View File

@@ -5,8 +5,7 @@
*/
/**
* @fileoverview Generating JavaScript for math blocks.
* @suppress {missingRequire}
* @file Generating JavaScript for math blocks.
*/
// Former goog.module ID: Blockly.JavaScript.math

View File

@@ -5,7 +5,7 @@
*/
/**
* @fileoverview Generating JavaScript for procedure blocks.
* @file Generating JavaScript for procedure blocks.
*/
// Former goog.module ID: Blockly.JavaScript.procedures

View File

@@ -5,7 +5,7 @@
*/
/**
* @fileoverview Generating JavaScript for text blocks.
* @file Generating JavaScript for text blocks.
*/
// Former goog.module ID: Blockly.JavaScript.texts

View File

@@ -5,7 +5,7 @@
*/
/**
* @fileoverview Generating JavaScript for variable blocks.
* @file Generating JavaScript for variable blocks.
*/
// Former goog.module ID: Blockly.JavaScript.variables

View File

@@ -5,7 +5,7 @@
*/
/**
* @fileoverview Generating JavaScript for dynamic variable blocks.
* @file Generating JavaScript for dynamic variable blocks.
*/
// Former goog.module ID: Blockly.JavaScript.variablesDynamic