BatchFormat – Remove Unused ‘Usings’ And Format Visual Studio Document

Do you often find it challenging to clean code file from unnecessary statements, imported snippets, functions, etc., and also to indent code, sort or remove unused Using directives in Visual Studio document? Visual Studio, just like many other software development IDEs, doesn’t provide features to clean the code file from such superfluous content, which makes it hard to not only dry run the code but visually scanning the important code modules present in document a tiresome task as well. What you probably need is a plugin which can automate the process of formatting documents without requiring you to find code format irregularities. BatchFormat is Visual Studio 2010 add-in to format document by removing and sorting different elements of any code file in current solution.

BatchFormat includes 3 options to deal with Using directives in your C # code files – Remove Unused Usings, Sort Usings, and Remove and Sort Usings. For instance, if you want to remove redundant Using directives from the code file, select Remove Unused Usings option from document right-click context menu, present in Solution Explorer, whereas, to remove unused Usings and sort others, go for Remove and Sort Usings option.

Before installing the plug-in, close all instances of Visual Studio. Once installed, it will add BatchFormat menu in Solution Explorer right-click menu. Just select the document you want to format followed by required formatting option from BatchFormat menu. The Format Document option helps you quickly indent code of current document. Other formatting options include, Format and Sort Usings in Document, and Remove & Sort Usings And Format Document.

batchformat main


BatchFormat uses Visual Studio Output console to display its process results. When you select an option from BatchFormat menu, it will display the output results underneath the main window.

output (2)

BactchFormat is an open source plugin that works on Visual Studio 2010.

Download BatchFormat

Advertisement