PowerShellEditorServices icon indicating copy to clipboard operation
PowerShellEditorServices copied to clipboard

Language service should be able to find variable references inside of strings

Open daviwil opened this issue 10 years ago • 2 comments

This affects references/occurrences finding and variable renaming. An example from Kirk:

function Write-Item($itemCount)
{
    $i = 1

    while ($i -le $itemCount)
    {
        $str = "Output ${i}"
        Write-Output $str
        $i = $i + 1
    }
}

If you attempt to rename the variable $i, the instance inside of the output string does not get renamed.

daviwil avatar Oct 30 '15 18:10 daviwil

I believe this is working now but I don't quite know how to "rename" unless you mean through the search menu.

TylerLeonhardt avatar Jan 17 '18 02:01 TylerLeonhardt

I think rename may be broken for us now since the LSP got new message types for performing renames. However, I think finding/renaming variables in strings did work the last time I tried it.

daviwil avatar Jan 17 '18 02:01 daviwil