I finally downloaded Simian today to give it a test drive, and already I think I'm going to love this tool. If you don't know what Simian is, its a tool to automatically locate duplicate lines of code and any good programmer should love to delete duplicated code, which where I work is pretty important.
Simian being a console application is pretty useful, but being able to click a button from Visual Studio, see the output in the output window, and then being able to navigate to the duplicated lines by double clicking is what I really wanted. So that's what I did, I created a Simian output formatter that transforms the output to MSBuild formatted output that is clickable! Cool, how do we use it?
Download and copy the formatting tool somewhere, I put it in my Simian bin directory. Create a batch file in this same directory, the batch file is used to pipe the Simian results to the formatter because Visual Studio doesn't let you from the external tools menu. My batch file looks like this:
@ECHO OFFREM Run simian redirecting output to the MSBuild formatterC:\"Program Files (x86)"\Simian\bin\simian-2.2.24.exe %1 | C:\"Program Files (x86)"\Simian\bin\SimianMsBuildFormatter.exe
With that out of the way we need to setup Simian as an external tool within Visual Studio. In this example I will setup Simian for the current file:
Now Simian - Current File will show up in the Visual Studio Tools menu. With a file open in the editor we just need to click our new menu item to run Simian and get our output. Here's an example output run.
The interesting and useful part is that the source files listed in the output are now clickable, just like from the csc compiler. Happy dupe finding!
Remember Me
a@href@title, strike
Powered by: newtelligence dasBlog 2.1.8102.813
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2010, Shawn Neal
E-mail