[intelli-lang] `CommonInjectedFileChangesHandler` some comments related to (IDEA...
authorNicolay Mitropolsky <nicolay.mitropolsky@jetbrains.com>
Wed, 12 Aug 2020 08:38:05 +0000 (11:38 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Wed, 12 Aug 2020 08:41:43 +0000 (08:41 +0000)
GitOrigin-RevId: 5b2ea4cbd9544a4fabe760b4719d9532ebff12ee

platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/changesHandler/CommonInjectedFileChangesHandler.kt

index 2c4e44eee5155cc76d860ba01662e333158a1b3b..77fe9217e290a6ad4112a8198baecf1f6a527eac 100644 (file)
@@ -74,6 +74,7 @@ open class CommonInjectedFileChangesHandler(
         val localInsideFile = ProperTextRange(max(localInsideFileCursor, fragmentMarker.startOffset), fragmentMarker.endOffset)
         if (insideHost != null) {
           //append unchanged inter-markers fragment
+          //FIXME: hostText is already encoded but `handleContentChange` will encode it again (see IDEA-248039)
           sb.append(hostText, insideHost.endOffset, localInsideHost.startOffset)
         }
 
@@ -90,6 +91,7 @@ open class CommonInjectedFileChangesHandler(
   }
 
   protected fun updateInjectionHostElement(host: PsiLanguageInjectionHost, insideHost: ProperTextRange, content: String) {
+    // NOTE: return value is ignored and it works only because we update one host only once
     ElementManipulators.handleContentChange(host, insideHost, content)
   }