Disable warnings and reformatting for designer generated code?

Using ReSharper2.0 build #249 with VS2003 (German version) works fine, except the fact that designer generated code (InitializeComponent) is checked and reformatted. This is horrible because the VS designer reformats the code again...

There is an old thread where this topic has already been discussed:
http://www.intellij.net/forums/thread.jspa?messageID=4897512??

Is there a possibility to avoid reformatting and warnings inside of the "InitializeComponent" area?


Thanks,
Thomas

4 comments
Comment actions Permalink

Hi,

I have a similiar feature request. We have a lot of code that is generated by our own code generator. Since the generator is not highly optimized and generates sometimes redundant using, casts, etc., it would be nice to turn of highlighting for specific warnings for the generated files. E.g. by special comments at the beginning of the file or by using a special region, ...

Regards,
Uwe

0
Comment actions Permalink

The dataset generator adds this attribute:

[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]

So, maybe ReSharper should check for GeneratedCodeAttribute, and other codegens should also emit an attribute like that?

0
Comment actions Permalink

I wrote to Jetbrains two mails, only one has been answered with the following content:
"[...] We're not planning to fix this problem " (Andrey Serebryansky)

I found out that ReSharper detects the protected areas by seraching for "#region Designer generated code".
You may let your code-generator generate a so named region around the whole code it generates to disable this warnings.


Best regards,
Thomas

0
Comment actions Permalink

Well, that is not so usefull anymore, for VSNET 2003, that was mostly the case, but take a look at generated code in vsnet2005, like datasets etc.
Not that Datasets are to be edited, but when you open an dataset.designer.cs codefile, with 5000+ lines, it takes a little while becouse of checking this.

0

Please sign in to leave a comment.