pxt icon indicating copy to clipboard operation
pxt copied to clipboard

Block "Math.abs" can't load in "Guitar"

Open Sheila111 opened this issue 3 years ago • 1 comments

Describe the bug Block "Math.abs" can't load in "Guitar"

Steps to reproduce the behavior 1.Navigate to https://makecode.microbit.org/projects/guitar/accelerometer 2.Click "Math.abs"

Expect behavior It can load

Actual behavior Block "Math.abs" can't load in "Guitar" 1

Additional context 1.OS: Windows(rs6) 2.makecode.microbit.org version: 3.1.79 3.Microsoft MakeCode version: 6.13.25

Sheila111 avatar Apr 25 '21 02:04 Sheila111

The help path is formed incorrectly for functions in pxt-helpers.ts. The "/reference/" path prefix isn't prepended to the function's help= subpath as needed. The reference doc path is ./reference/math/abs.md so the render code needs to add the ./reference/ piece. This is a pxt bug.

//% help=math/abs
export function abs(x: number): number {
    return x < 0 ? -x : x;
}

image

ganicke avatar May 11 '21 19:05 ganicke