Correctly map SuggestedCorrection to MarkerCorrection#1749
Correctly map SuggestedCorrection to MarkerCorrection#1749andyleejordan merged 3 commits intoPowerShell:masterfrom
SuggestedCorrection to MarkerCorrection#1749Conversation
andyleejordan
left a comment
There was a problem hiding this comment.
Everything looks good, just one recurring test value. Some collection is coming through null and something isn't happy about it 😅 Thank you for working on this, excited to get it in!
src/PowerShellEditorServices/Services/Analysis/AnalysisService.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Andy Schwartzmeyer <andrew@schwartzmeyer.com>
|
Yes, saw the test failure only after I opened the PR. Somehow, I cannot run the test with VS2022 with test explorer, can you give me some tips how I can run it locally to figure out why the value ends up being null by attaching the debugger and stepping through. Also happy to use VS Code instead alternatives |
|
I exclusively use the C# extension in VS Code, it adds a "Run Test" and "Debug Test" code lens to each unit test, and it works great! |
|
Thanks. I suspect it must be a problem of the XUnit VisualStudio NuGet package. It did work in VS-Code out of the box but due to the async nature I couldn't step through the code. I had a suspicion though and noticed a boolean logic in one of my refactoring was not done correctly, so I adjusted that, which fixed the test. |
|
Good catch! |
SuggestedCorrection to MarkerCorrection
|
Hey @bergmeister, I've added a PSSA test suite, what do you think a regression test for this would look like? See: https://github.com/PowerShell/PowerShellEditorServices/blob/main/test/PowerShellEditorServices.Test/Services/Symbols/PSScriptAnalyzerTests.cs |
With the recent fix in PR #1718, PSES processes now all Correction objects from PSSA but the message specifically was just taken from the last correction here. I did not notice this at first because I thought I had to tweak my rule first to emit two different messages until I realized it was another bug in PSES.
Related: PowerShell/PSScriptAnalyzer#1782
Proof here that the message of each correction is associated to it as well (the actual code fix already was)
BEFORE

AFTER
