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

Investigate what happens in the rename processor #192

Open ForNeVeR opened 6 months ago

ForNeVeR commented 6 months ago

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

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

It explains an issue that caused us to rely on the find usages handler instead of the normal code flow in that place. The message from the commit introducing that line (7d1415ecabeb702c9cb727ddca561f636c8e7019) also tries to explain a bit:

  • if identifier has sub-expression search for references using Find Usages Handler

I don't fully understand what's happening there currently, though: what is a PowerShellComponent? What does "identifier has sub-expression" mean? Is it about "identifiers" such as $script:MyVariable? Why is something not handled by the default flow there?

We should figure it out and either fix or provide a better explanation.