ant-druha / intellij-powershell

Adds PowerShell language support to IntelliJ-based IDEs.
https://plugins.jetbrains.com/plugin/10249-powershell
Apache License 2.0
71 stars 20 forks source link

Language Injections: use correct range when processing #190

Open ForNeVeR opened 6 months ago

ForNeVeR commented 6 months ago

Currently, there's a code in the language inhection processor that always reconstructs the text range from the edited element.

The reason for that behavior is unclear. Ideally, we should use the passed text range and not rely on the whole content. Perhaps we can act in a more optimal way.

See the code near this line: https://github.com/ant-druha/intellij-powershell/blob/baccc65fb41e834e8eb66642911f1a1259926856/src/main/kotlin/com/intellij/plugin/powershell/ide/injection/PowerShellStringManipulator.kt#L20

Also, look for the number of this issue in the project code base.