Commit 0beff82
committed
Fix incorrect parser errors from unloaded assemblies
An attempt to fix #5381 where we believe the cause is that the didOpen()/didChange()
notifications are being sent before PowerShell has totally finished loading.
Since these run the PowerShell parser on the OmniSharp thread pool,
they essentially race the analysis of the files by PSScriptAnalyzer on the
PowerShell runspace pool. So when they beat it, the return errors.
But when they're beaten by it, the PSSA analysis has caused the assemblies
(and so custom attributes) to be loaded, no longer erroring.
I posited we could gate the notifications instead of duplicating them
like in #5402, and if the `Middleware` works as suspected by me (and Claude)
this should fix it. Morever, we now also use a proper `Promise` instead of
a while loop around a sleep to wait for the LSP server to be running.
While all of this could just be an AI hallucination...it seems right.1 parent f9e4670 commit 0beff82
1 file changed
+34
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
129 | 134 | | |
130 | 135 | | |
131 | 136 | | |
| |||
295 | 300 | | |
296 | 301 | | |
297 | 302 | | |
| 303 | + | |
298 | 304 | | |
299 | 305 | | |
300 | 306 | | |
| |||
328 | 334 | | |
329 | 335 | | |
330 | 336 | | |
| 337 | + | |
331 | 338 | | |
332 | 339 | | |
333 | 340 | | |
| |||
497 | 504 | | |
498 | 505 | | |
499 | 506 | | |
500 | | - | |
501 | | - | |
502 | | - | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
503 | 534 | | |
504 | 535 | | |
505 | 536 | | |
| |||
0 commit comments