Using statements to re-insert being ignored
I have two using statements I want to re-insert any time the code is cleaned on save. I've gone into Cleaning -> Visual Studio and checked Run remove using statements, and in the re-insert box I have: using System; using System.Linq;
But when I save it doesn't respect either of the statements to be re-inserted.
By default, using statements are not removed (or re-inserted) during cleanup on save unless you disable the defaulted option "Skip during automatic cleanup on save" which is indented within the "Run remove unused using statements" option. This is off by default as it can cause conflicts with other tools.
If that doesn't resolve the issue, please provide an export of your settings.
Thanks for the reply. Settings available here - https://www.dropbox.com/s/160z2er87a0ehgy/CodeMaid.settings?dl=0
I have Run remove unused using statements checked, and skip is unchecked.
Sorry, hit the wrong button there!
Thanks for providing your settings. Those look correct to me, and work as expected for me. Here's a sample code file:
using System;
using System.Linq;
namespace SpecificIssues
{
internal class Issue100
{
}
}
Note: This feature is for "Using statements to re-insert when removed". It will not add those using statements if they were not already present.
Can you provide a code sample that isn't working as expected?
Also, please note there is a known related issue with #87 about multiple statements including a blank line between them with the latest beta.
Steve, I'm a total idiot and I've wasted your time! I've just realised that I had the VS Productivity Power Tools installed, and it also has a format and remove using statements function which was overriding codemaid. I've disabled that and lo and behold it's now working as it should be.
No worries, glad you got it figured out.