You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, PSSA's `SuggestCorrections` property of the
`DiagnosticRecord` object already is an array, but no built-in rules
return more than one suggested correction, which led to
`PowerShellEditorServices` not correctly translating this array before
returning it as an code action as it only ever displayed one. This fixes
it by making it generic again so it returns a code action for each
suggest correction. It's basically just performing a `foreach` loop and
calling `ToTextEdit` just once.
This is a pre-requisite for an implementation of this, where a built-in
rule will return multiple suggest corrections:
PowerShell/PSScriptAnalyzer#1767
I've manually tested this with a modified version of PSScriptAnalyzer
where I return two suggested corrections. The extension's UI now shows
me the two different suggested code actions and also applies them
correctly.
0 commit comments