First approach to fix issue with dbg/run start before PSES running #1436
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary
Fix #1433
One minor issue is that if you abort (return null|undefined) from
resolveDebugConfiguration, VSCode "helpfully" opens your launch.json
file for you. Actually, that is quite annoying. I found an issue and on
this and voted it up - microsoft/vscode#54213
Also fix logic for "attach" error. We only need to test if
OS != Windows. If on Windows, PS Core supports attach. And tweaked the
error message wording to make more clear.
If the user attempts to start a dgb or "run with out debugging" session
before PSES is running, a NullRefEx occurs in PSES. Ideally, we would
wait in the resolveDebugConfiguration method for PSES to finish
initializing with a max wait time of say 10 seconds. Unfortunately,
"sleep" in a loop in JavaScript is not so easy. AFAIT requires a
significant rewrite of the method using setTimeout(). Not sure it is
worth it, unless someone more knowledgable in JS can find an easy
way to do the poll (for sessionstatus)/sleep loop.
BTW there is probably a fix we need to make in PSES to check if
SynchronizationContext is not null before we try to use it.
PR Checklist
Note: Tick the boxes below that apply to this pull request by putting an
x
between the square brackets.Please mark anything not applicable to this PR
NA
.WIP:
to the beginning of the title and remove the prefix when the PR is ready