Skip to content

Commit 6d051f8

Browse files
author
Andy
authored
Handle CodeFixAction in mapCodeAction (microsoft#21247)
* Handle CodeFixAction in mapCodeAction * Update API baseline
1 parent b5ae9de commit 6d051f8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/server/session.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,9 +1665,9 @@ namespace ts.server {
16651665
return { startPosition, endPosition };
16661666
}
16671667

1668-
private mapCodeAction(project: Project, { description, changes: unmappedChanges, commands }: CodeAction): protocol.CodeAction {
1668+
private mapCodeAction(project: Project, { description, changes: unmappedChanges, commands, fixId }: CodeFixAction): protocol.CodeFixAction {
16691669
const changes = unmappedChanges.map(change => this.mapTextChangesToCodeEditsUsingScriptinfo(change, project.getScriptInfoForNormalizedPath(toNormalizedPath(change.fileName))));
1670-
return { description, changes, commands };
1670+
return { description, changes, commands, fixId };
16711671
}
16721672

16731673
private mapTextChangesToCodeEdits(project: Project, textChanges: ReadonlyArray<FileTextChanges>): protocol.FileCodeEdits[] {

tests/baselines/reference/api/tsserverlibrary.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7256,7 +7256,7 @@ declare namespace ts.server {
72567256
private getCombinedCodeFix({scope, fixId}, simplifiedResult);
72577257
private applyCodeActionCommand(args);
72587258
private getStartAndEndPosition(args, scriptInfo);
7259-
private mapCodeAction(project, {description, changes: unmappedChanges, commands});
7259+
private mapCodeAction(project, {description, changes: unmappedChanges, commands, fixId});
72607260
private mapTextChangesToCodeEdits(project, textChanges);
72617261
private mapTextChangesToCodeEditsUsingScriptinfo(textChanges, scriptInfo);
72627262
private convertTextChangeToCodeEdit(change, scriptInfo);

0 commit comments

Comments
 (0)