@@ -1230,7 +1230,7 @@ namespace ts.server {
1230
1230
return project . getLanguageService ( ) . getCompletionEntryDetails ( file , position , name , formattingOptions , source ) ;
1231
1231
} ) ;
1232
1232
return simplifiedResult
1233
- ? result . map ( details => ( { ...details , codeActions : map ( details . codeActions , action => this . mapCodeAction ( action , scriptInfo ) ) } ) )
1233
+ ? result . map ( details => ( { ...details , codeActions : map ( details . codeActions , action => this . mapCodeAction ( project , action ) ) } ) )
1234
1234
: result ;
1235
1235
}
1236
1236
@@ -1560,7 +1560,7 @@ namespace ts.server {
1560
1560
return undefined ;
1561
1561
}
1562
1562
if ( simplifiedResult ) {
1563
- return codeActions . map ( codeAction => this . mapCodeAction ( codeAction , scriptInfo ) ) ;
1563
+ return codeActions . map ( codeAction => this . mapCodeAction ( project , codeAction ) ) ;
1564
1564
}
1565
1565
else {
1566
1566
return codeActions ;
@@ -1613,8 +1613,8 @@ namespace ts.server {
1613
1613
return { startPosition, endPosition } ;
1614
1614
}
1615
1615
1616
- private mapCodeAction ( { description, changes : unmappedChanges , commands } : CodeAction , scriptInfo : ScriptInfo ) : protocol . CodeAction {
1617
- const changes = unmappedChanges . map ( change => this . mapTextChangesToCodeEditsUsingScriptinfo ( change , scriptInfo ) ) ;
1616
+ private mapCodeAction ( project : Project , { description, changes : unmappedChanges , commands } : CodeAction ) : protocol . CodeAction {
1617
+ const changes = unmappedChanges . map ( change => this . mapTextChangesToCodeEditsUsingScriptinfo ( change , project . getScriptInfoForNormalizedPath ( toNormalizedPath ( change . fileName ) ) ) ) ;
1618
1618
return { description, changes, commands } ;
1619
1619
}
1620
1620
0 commit comments