From 37f4f971bde737fe92ca3ba083cc037c700394f1 Mon Sep 17 00:00:00 2001 From: thsparks Date: Thu, 26 Sep 2024 10:25:55 -0700 Subject: [PATCH] More compiler noodling, doesn't do anything yet --- pxtblocks/compiler/compiler.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pxtblocks/compiler/compiler.ts b/pxtblocks/compiler/compiler.ts index 89d6622a74da..2bce44af42f7 100644 --- a/pxtblocks/compiler/compiler.ts +++ b/pxtblocks/compiler/compiler.ts @@ -8,8 +8,9 @@ import { append, countOptionals, escapeVarName, forEachChildExpression, getInput import { isArrayType } from "../toolbox"; import { MutatorTypes } from "../legacyMutations"; import { trackAllVariables } from "./variables"; -import { FieldTilemap, FieldTextInput } from "../fields"; +import { FieldTilemap, FieldTextInput, getBlockDataForField } from "../fields"; import { CommonFunctionBlock } from "../plugins/functions/commonFunctionMixin"; +import { REVIEW_COMMENT_FIELD_NAME } from "../plugins/comments/reviewCommentIcon"; interface Rect { @@ -801,6 +802,13 @@ function maybeAddComment(b: Blockly.Block, comments: string[]) { } } +function maybeAddReviewComment(b: Blockly.Block, reviewComments: string[]) { + const reviewComment = getBlockDataForField(b, REVIEW_COMMENT_FIELD_NAME); + if (reviewComment) { + reviewComments.push(reviewComment); + } +} + function addCommentNodes(comments: string[], r: pxt.blocks.JsNode[]) { const commentNodes: pxt.blocks.JsNode[] = [] @@ -1347,4 +1355,4 @@ function eventArgs(call: StdFunc, b: Blockly.Block): pxt.blocks.BlockParameter[] export function workerOpAsync(op: string, arg: pxtc.service.OpArg) { return pxt.worker.getWorker(pxt.webConfig.workerjs).opAsync(op, arg) -} \ No newline at end of file +}