File tree Expand file tree Collapse file tree 1 file changed +18
-15
lines changed
src/PowerShellEditorServices/Services/TextDocument/Handlers Expand file tree Collapse file tree 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
8181 string diagnosticId = AnalysisService . GetUniqueIdFromDiagnostic ( diagnostic ) ;
8282 if ( corrections . TryGetValue ( diagnosticId , out MarkerCorrection correction ) )
8383 {
84- codeActions . Add ( new CodeAction
84+ foreach ( ScriptRegion edit in correction . Edits )
8585 {
86- Title = correction . Name ,
87- Kind = CodeActionKind . QuickFix ,
88- Edit = new WorkspaceEdit
86+ codeActions . Add ( new CodeAction
8987 {
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
9595 {
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+ }
102105 }
103106 }
104107
You can’t perform that action at this time.
0 commit comments