codeformatter icon indicating copy to clipboard operation
codeformatter copied to clipboard

CodeFormatter doesn't replace delegate call locations on rename

Open CIPop opened this issue 10 years ago • 5 comments

Replaced: private Func<object, bool> _callback;

But didn't replace: if (!m_callback(targetObj))

CIPop avatar Sep 04 '15 23:09 CIPop

Thanks for reporting!

@dpoeschl is this a known issue in the rename tracking code?

jaredpar avatar Sep 08 '15 16:09 jaredpar

Rename works as expected in this standalone example (on the current master bits)

class C
{
    private System.Func<object, bool> m_callback; // rename to "_callback"

    void M()
    {
        if (!m_callback(new object())) { }
    }
}

dpoeschl avatar Sep 08 '15 16:09 dpoeschl

@dpoeschl I wonder if it's because the latest release is still using a pre-RTM version of Roslyn.

jaredpar avatar Sep 08 '15 16:09 jaredpar

Just tested against VS 2015 RTM, and the rename works as expected there too.

You mean that the current codeformatter release uses a pre-RTM version of Roslyn? I don't remember any rename issues like this being fixed at the last minute...

Can you or @CIPop share any more context on the rename failure that occurred so I can dig a bit deeper? Maybe the actual scenario is somehow more subtle than the repro I produced above.

dpoeschl avatar Sep 08 '15 16:09 dpoeschl

I ran CodeFormatter 1.0.0-alpha5 on code within the System.Net.Security from my private fork, the sn2 branch.

I'm running on Win10 + Visual Studio 2015 RTM.

After running the formatter, build failed for me: there are a few items in PinnableBufferCache.cs that were not renamed correctly.

CIPop avatar Sep 08 '15 17:09 CIPop