@@ -4091,7 +4091,8 @@ declare namespace ts {
40914091 getDocCommentTemplateAtPosition ( fileName : string , position : number ) : TextInsertion ;
40924092 isValidBraceCompletionAtPosition ( fileName : string , position : number , openingBrace : number ) : boolean ;
40934093 getSpanOfEnclosingComment ( fileName : string , position : number , onlyMultiLine : boolean ) : TextSpan ;
4094- getCodeFixesAtPosition ( fileName : string , start : number , end : number , errorCodes : ReadonlyArray < number > , formatOptions : FormatCodeSettings ) : ReadonlyArray < CodeAction > ;
4094+ getCodeFixesAtPosition ( fileName : string , start : number , end : number , errorCodes : ReadonlyArray < number > , formatOptions : FormatCodeSettings ) : ReadonlyArray < CodeFixAction > ;
4095+ getCombinedCodeFix ( scope : CombinedCodeFixScope , fixId : { } , formatOptions : FormatCodeSettings ) : CombinedCodeActions ;
40954096 applyCodeActionCommand ( action : CodeActionCommand ) : Promise < ApplyCodeActionCommandResult > ;
40964097 applyCodeActionCommand ( action : CodeActionCommand [ ] ) : Promise < ApplyCodeActionCommandResult [ ] > ;
40974098 applyCodeActionCommand ( action : CodeActionCommand | CodeActionCommand [ ] ) : Promise < ApplyCodeActionCommandResult | ApplyCodeActionCommandResult [ ] > ;
@@ -4107,6 +4108,10 @@ declare namespace ts {
41074108 getProgram ( ) : Program ;
41084109 dispose ( ) : void ;
41094110 }
4111+ interface CombinedCodeFixScope {
4112+ type : "file" ;
4113+ fileName : string ;
4114+ }
41104115 interface GetCompletionsAtPositionOptions {
41114116 includeExternalModuleExports : boolean ;
41124117 includeInsertTextCompletions : boolean ;
@@ -4184,6 +4189,17 @@ declare namespace ts {
41844189 */
41854190 commands ?: CodeActionCommand [ ] ;
41864191 }
4192+ interface CodeFixAction extends CodeAction {
4193+ /**
4194+ * If present, one may call 'getCombinedCodeFix' with this fixId.
4195+ * This may be omitted to indicate that the code fix can't be applied in a group.
4196+ */
4197+ fixId ?: { } ;
4198+ }
4199+ interface CombinedCodeActions {
4200+ changes : ReadonlyArray < FileTextChanges > ;
4201+ commands : ReadonlyArray < CodeActionCommand > | undefined ;
4202+ }
41874203 type CodeActionCommand = InstallPackageAction ;
41884204 interface InstallPackageAction {
41894205 }
@@ -5027,6 +5043,7 @@ declare namespace ts.server.protocol {
50275043 DocCommentTemplate = "docCommentTemplate" ,
50285044 CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects" ,
50295045 GetCodeFixes = "getCodeFixes" ,
5046+ GetCombinedCodeFix = "getCombinedCodeFix" ,
50305047 ApplyCodeActionCommand = "applyCodeActionCommand" ,
50315048 GetSupportedCodeFixes = "getSupportedCodeFixes" ,
50325049 GetApplicableRefactors = "getApplicableRefactors" ,
@@ -5389,6 +5406,13 @@ declare namespace ts.server.protocol {
53895406 command : CommandTypes . GetCodeFixes ;
53905407 arguments : CodeFixRequestArgs ;
53915408 }
5409+ interface GetCombinedCodeFixRequest extends Request {
5410+ command : CommandTypes . GetCombinedCodeFix ;
5411+ arguments : GetCombinedCodeFixRequestArgs ;
5412+ }
5413+ interface GetCombinedCodeFixResponse extends Response {
5414+ body : CombinedCodeActions ;
5415+ }
53925416 interface ApplyCodeActionCommandRequest extends Request {
53935417 command : CommandTypes . ApplyCodeActionCommand ;
53945418 arguments : ApplyCodeActionCommandRequestArgs ;
@@ -5422,6 +5446,14 @@ declare namespace ts.server.protocol {
54225446 */
54235447 errorCodes ?: ReadonlyArray < number > ;
54245448 }
5449+ interface GetCombinedCodeFixRequestArgs {
5450+ scope : GetCombinedCodeFixScope ;
5451+ fixId : { } ;
5452+ }
5453+ interface GetCombinedCodeFixScope {
5454+ type : "file" ;
5455+ args : FileRequestArgs ;
5456+ }
54255457 interface ApplyCodeActionCommandRequestArgs {
54265458 /** May also be an array of commands. */
54275459 command : { } ;
@@ -6164,7 +6196,7 @@ declare namespace ts.server.protocol {
61646196 }
61656197 interface CodeFixResponse extends Response {
61666198 /** The code actions that are available */
6167- body ?: CodeAction [ ] ;
6199+ body ?: CodeFixAction [ ] ;
61686200 }
61696201 interface CodeAction {
61706202 /** Description of the code action to display in the UI of the editor */
@@ -6174,6 +6206,17 @@ declare namespace ts.server.protocol {
61746206 /** A command is an opaque object that should be passed to `ApplyCodeActionCommandRequestArgs` without modification. */
61756207 commands ?: { } [ ] ;
61766208 }
6209+ interface CombinedCodeActions {
6210+ changes : ReadonlyArray < FileCodeEdits > ;
6211+ commands ?: ReadonlyArray < { } > ;
6212+ }
6213+ interface CodeFixAction extends CodeAction {
6214+ /**
6215+ * If present, one may call 'getCombinedCodeFix' with this fixId.
6216+ * This may be omitted to indicate that the code fix can't be applied in a group.
6217+ */
6218+ fixId ?: { } ;
6219+ }
61776220 /**
61786221 * Format and format on key response message.
61796222 */
0 commit comments