Skip to content

Commit b198e2f

Browse files
authored
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.
1 parent ac362fd commit b198e2f

33 files changed

Lines changed: 41 additions & 43 deletions

generators/dart.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
*/
66

77
/**
8-
* @fileoverview Complete helper functions for generating Dart for
9-
* blocks. This is the entrypoint for dart_compressed.js.
10-
* @suppress {extraRequire}
8+
* @file Instantiate a DartGenerator and populate it with the complete
9+
* set of block generator functions for Dart. This is the entrypoint
10+
* for dart_compressed.js.
1111
*/
1212

1313
// Former goog.module ID: Blockly.Dart.all

generators/dart/colour.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
/**
8-
* @fileoverview Generating Dart for colour blocks.
8+
* @file Generating Dart for colour blocks.
99
*/
1010

1111
// Former goog.module ID: Blockly.Dart.colour

generators/dart/dart_generator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,15 +269,15 @@ export class DartGenerator extends CodeGenerator {
269269
* @param delta Value to add.
270270
* @param negate Whether to negate the value.
271271
* @param order The highest order acting on this value.
272-
* @returns The adjusted value.
272+
* @returns The adjusted value or code that evaluates to it.
273273
*/
274274
getAdjusted(
275275
block: Block,
276276
atId: string,
277277
delta = 0,
278278
negate = false,
279279
order = Order.NONE,
280-
): string | number {
280+
): string {
281281
if (block.workspace.options.oneBasedIndex) {
282282
delta--;
283283
}

generators/dart/lists.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
/**
8-
* @fileoverview Generating Dart for list blocks.
8+
* @file Generating Dart for list blocks.
99
*/
1010

1111
// Former goog.module ID: Blockly.Dart.lists

generators/dart/logic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
/**
8-
* @fileoverview Generating Dart for logic blocks.
8+
* @file Generating Dart for logic blocks.
99
*/
1010

1111
// Former goog.module ID: Blockly.Dart.logic

generators/dart/loops.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
/**
8-
* @fileoverview Generating Dart for loop blocks.
8+
* @file Generating Dart for loop blocks.
99
*/
1010

1111
// Former goog.module ID: Blockly.Dart.loops

generators/dart/math.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
/**
8-
* @fileoverview Generating Dart for math blocks.
8+
* @file Generating Dart for math blocks.
99
*/
1010

1111
// Former goog.module ID: Blockly.Dart.math

generators/dart/procedures.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
/**
8-
* @fileoverview Generating Dart for procedure blocks.
8+
* @file Generating Dart for procedure blocks.
99
*/
1010

1111
// Former goog.module ID: Blockly.Dart.procedures

generators/dart/text.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
/**
8-
* @fileoverview Generating Dart for text blocks.
8+
* @file Generating Dart for text blocks.
99
*/
1010

1111
// Former goog.module ID: Blockly.Dart.texts

generators/dart/variables.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
/**
8-
* @fileoverview Generating Dart for variable blocks.
8+
* @file Generating Dart for variable blocks.
99
*/
1010

1111
// Former goog.module ID: Blockly.Dart.variables

0 commit comments

Comments
 (0)