-
-
Notifications
You must be signed in to change notification settings - Fork 160
Open
Description
I THINK this occurs when:
- A heredoc is a
non-interpolating sigil
(~S"""
). - Language injection occurs inside it (??).
- A SmartPsiElementPointer is created for an element in the injected PSI.
Confused yet?
It seems:
- On pointer restoration, IntelliJ 2025.1+ now throws an error if the pointer can’t be mapped back to the host via the
LiteralTextEscaper
. - Investigation with a custom fixture test shows that our
LiteralTextEscaper
mapping forElixirLiteralSigilHeredocImpl
fails — likely due to trimming indentation and/or removing the terminator indecode
, which shifts offsets. - This bug did not cause test failures in earlier platform versions because the platform previously logged the error as a warning (yay).
Impact
- All usages/search features relying on SmartPsiElementPointers for injected elements in
~S
heredocs will break in 2025.1+. - Affects at least
FindUsagesTest.testFunctionRecursiveUsage
and other tests scanningkernel.ex
.
Possible fixes
- Identity escaper for
~S
heredocs
For non-interpolating heredocs, map decoded text 1:1 with the host range — no trimming or unescaping — so
getOffsetInHost
is a direct addition.
- Skip injection in
~S
heredocs entirely (as a temporary workaround).
Metadata
Metadata
Assignees
Labels
No labels