@@ -1230,7 +1230,7 @@ namespace ts.server {
12301230 return project . getLanguageService ( ) . getCompletionEntryDetails ( file , position , name , formattingOptions , source ) ;
12311231 } ) ;
12321232 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 ) ) } ) )
12341234 : result ;
12351235 }
12361236
@@ -1560,7 +1560,7 @@ namespace ts.server {
15601560 return undefined ;
15611561 }
15621562 if ( simplifiedResult ) {
1563- return codeActions . map ( codeAction => this . mapCodeAction ( codeAction , scriptInfo ) ) ;
1563+ return codeActions . map ( codeAction => this . mapCodeAction ( project , codeAction ) ) ;
15641564 }
15651565 else {
15661566 return codeActions ;
@@ -1613,8 +1613,8 @@ namespace ts.server {
16131613 return { startPosition, endPosition } ;
16141614 }
16151615
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 ) ) ) ) ;
16181618 return { description, changes, commands } ;
16191619 }
16201620
0 commit comments