55
66using System ;
77using System . Collections . Generic ;
8+ using System . Linq ;
89using System . Threading ;
910using System . Threading . Tasks ;
1011using Microsoft . Extensions . Logging ;
@@ -85,11 +86,16 @@ public async Task<CommandOrCodeActionContainer> Handle(CodeActionParams request,
8586 string diagnosticId = AnalysisService . GetUniqueIdFromDiagnostic ( diagnostic ) ;
8687 if ( corrections . TryGetValue ( diagnosticId , out MarkerCorrection correction ) )
8788 {
88- codeActions . Add ( new Command ( )
89+
90+ codeActions . Add ( new CodeAction
8991 {
90- Title = correction . Name ,
91- Name = "PowerShell.ApplyCodeActionEdits" ,
92- Arguments = JArray . FromObject ( correction . Edits )
92+ Kind = CodeActionKind . QuickFix ,
93+ Command = new Command
94+ {
95+ Title = correction . Name ,
96+ Name = "PowerShell.ApplyCodeActionEdits" ,
97+ Arguments = JArray . FromObject ( correction . Edits )
98+ }
9399 } ) ;
94100 }
95101 }
@@ -107,13 +113,15 @@ public async Task<CommandOrCodeActionContainer> Handle(CodeActionParams request,
107113 {
108114 ruleNamesProcessed . Add ( diagnostic . Code . String ) ;
109115
110- codeActions . Add (
111- new Command
116+ codeActions . Add ( new CodeAction
117+ {
118+ Command = new Command
112119 {
113120 Title = $ "Show documentation for \" { diagnostic . Code } \" ",
114121 Name = "PowerShell.ShowCodeActionDocumentation" ,
115122 Arguments = JArray . FromObject ( new [ ] { diagnostic . Code } )
116- } ) ;
123+ }
124+ } ) ;
117125 }
118126 }
119127
0 commit comments