File tree 1 file changed +18
-15
lines changed
src/PowerShellEditorServices/Services/TextDocument/Handlers
1 file changed +18
-15
lines changed Original file line number Diff line number Diff line change @@ -81,24 +81,27 @@ public override async Task<CommandOrCodeActionContainer> Handle(CodeActionParams
81
81
string diagnosticId = AnalysisService . GetUniqueIdFromDiagnostic ( diagnostic ) ;
82
82
if ( corrections . TryGetValue ( diagnosticId , out MarkerCorrection correction ) )
83
83
{
84
- codeActions . Add ( new CodeAction
84
+ foreach ( ScriptRegion edit in correction . Edits )
85
85
{
86
- Title = correction . Name ,
87
- Kind = CodeActionKind . QuickFix ,
88
- Edit = new WorkspaceEdit
86
+ codeActions . Add ( new CodeAction
89
87
{
90
- DocumentChanges = new Container < WorkspaceEditDocumentChange > (
91
- new WorkspaceEditDocumentChange (
92
- new TextDocumentEdit
93
- {
94
- TextDocument = new OptionalVersionedTextDocumentIdentifier
88
+ Title = correction . Name ,
89
+ Kind = CodeActionKind . QuickFix ,
90
+ Edit = new WorkspaceEdit
91
+ {
92
+ DocumentChanges = new Container < WorkspaceEditDocumentChange > (
93
+ new WorkspaceEditDocumentChange (
94
+ new TextDocumentEdit
95
95
{
96
- Uri = request . TextDocument . Uri
97
- } ,
98
- Edits = new TextEditContainer ( correction . Edits . Select ( ScriptRegion . ToTextEdit ) )
99
- } ) )
100
- }
101
- } ) ;
96
+ TextDocument = new OptionalVersionedTextDocumentIdentifier
97
+ {
98
+ Uri = request . TextDocument . Uri
99
+ } ,
100
+ Edits = new TextEditContainer ( ScriptRegion . ToTextEdit ( edit ) )
101
+ } ) )
102
+ }
103
+ } ) ;
104
+ }
102
105
}
103
106
}
104
107
You can’t perform that action at this time.
0 commit comments