ant-druha/intellij-powershell

Investigate what happens in the rename processor

ForNeVeR opened this issue · 0 comments

See the code near this line:

if (element is PowerShellComponent && nameHasSubExpression(element)) {//todo it's workaround to resort to findUsage handler because default index does not contain needed tokens

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 (7d1415e) 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.