Recompile inline function usages in JS when offset is changed

Otherwise source maps would differ after rebuild
This commit is contained in:
Alexey Tsvetkov
2017-12-07 04:03:36 +03:00
parent a31f503fa5
commit ad1978940b
2 changed files with 17 additions and 7 deletions
@@ -120,7 +120,16 @@ fun TranslationContext.wrapWithInlineMetadata(
else -> descriptor.fqNameSafe.asString()
}
processInlineFunction(file, fqName, functionWithMetadata)
val offset = sourceInfo?.node?.startOffset
val document = psiFile.viewProvider.document
var sourceLine = -1
var sourceColumn = -1
if (offset != null && document != null) {
sourceLine = document.getLineNumber(offset)
sourceColumn = offset - document.getLineStartOffset(sourceLine)
}
processInlineFunction(file, fqName, functionWithMetadata, sourceLine, sourceColumn)
}
functionWithMetadata