Could scrolllIntoView also be used for a line inside a fold range?

I need to scroll to a specific line. And the target line was inside a code block fold.

The code block range is from line 10 to line 20, and the target line was on line 15.

So, should I convert line 10 or line 15 to position then pass it to function scrollIntoView?

You should be able to scroll to a position inside the folded block and have it be interpreted as the position at the start of the fold, I believe.