Bug: In VSCode plugin, the guard syntax cannot step over through code line by line when in debug mode.
fn validate_semver(semver : String) -> Bool {
guard semver.length() != 0 else { return false }
guard check_chars_is_valid(semver) else { return false }
guard check_symbols_in_limit(semver) else { return false }
guard check_dots_not_consecutive(semver) else { return false }
guard check_neg_pos_symbols_is_order(semver) else { return false }
guard check_split_part_is_valide(semver) else { return false }
true
}
If the breakpoint is on the guard semver.length() != 0 else { return false }, using step over execution will directly jump to the true.
Thank you for reporting. I'm going to address it next week.
Thank you for reporting. I'm going to address it next week.
https://github.com/Seedking/SemVer you can directly test this bug in my project
It looks like the guard chain is compiled to ternary expression chain. So step over not works. This might not easy to fix, but there's a workaround:
You can use "> Disable Source Mapped Stepping" command in vscode, to degrade to javascript source debugging, at this view you can add inline/column breakpoints.
function Seedking$SemVer$$validate_semver(semver) {
return semver.length !== 0 ? (Seedking$SemVer$$check_chars_is_valid(semver) ? (Seedking$SemVer$$check_symbols_in_limit(semver) ? (Seedking$SemVer$$check_dots_not_consecutive(semver) ? (Seedking$SemVer$$check_neg_pos_symbols_is_order(semver) ? Seedking$SemVer$$check_split_part_is_valide(semver) : false) : false) : false) : false) : false;
}
It looks like the guard chain is compiled to ternary expression chain. So step over not works. This might not easy to fix, but there's a workaround:
You can use "> Disable Source Mapped Stepping" command in vscode, to degrade to javascript source debugging, at this view you can add inline/column breakpoints.
function Seedking$SemVer$$validate_semver(semver) { return semver.length !== 0 ? (Seedking$SemVer$$check_chars_is_valid(semver) ? (Seedking$SemVer$$check_symbols_in_limit(semver) ? (Seedking$SemVer$$check_dots_not_consecutive(semver) ? (Seedking$SemVer$$check_neg_pos_symbols_is_order(semver) ? Seedking$SemVer$$check_split_part_is_valide(semver) : false) : false) : false) : false) : false; }
thank you, i'll try this