dotnet / codeformatter

Tool that uses Roslyn to automatically rewrite the source to follow our coding styles
MIT License
1.24k stars 244 forks source link

CodeFormatter doesn't replace delegate call locations on rename #175

Open CIPop opened 9 years ago

CIPop commented 9 years ago

Replaced: private Func<object, bool> _callback;

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

jaredpar commented 9 years ago

Thanks for reporting!

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

dpoeschl commented 9 years ago

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())) { }
    }
}
jaredpar commented 9 years ago

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

dpoeschl commented 9 years ago

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.

CIPop commented 9 years ago

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.