diff --git a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/ToFromOriginalFileMapper.kt b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/ToFromOriginalFileMapper.kt index b7297c0b0b4..b48bcc4dbf2 100644 --- a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/ToFromOriginalFileMapper.kt +++ b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/ToFromOriginalFileMapper.kt @@ -47,8 +47,8 @@ class ToFromOriginalFileMapper private constructor( init { val originalText = originalFile.text val syntheticText = syntheticFile.text - val originalSubSequence = originalText.subSequence(0, completionOffset) - val syntheticSubSequence = syntheticText.subSequence(0, completionOffset) + val originalSubSequence = originalText.take(completionOffset) + val syntheticSubSequence = syntheticText.take(completionOffset) checkWithAttachment(originalSubSequence == syntheticSubSequence, { "original subText [len: ${originalSubSequence.length}]" + " does not match synthetic subText [len: ${syntheticSubSequence.length}]"