Current filter:
                                You should refresh the page.
                                  • Hey guys,

                                    In our project we want to include copyright headers. Currently only about half of the files have such a header with the company information, the user information and the date of creation of the file. Is it possible for CodeRush to check if there already exists a header and if yes, not overwrite it? Currently my template just creates a new Header and deletes the old header no matter what, which is not what i want.



                                • Pavel A (DevExpress) 06.26.2019

                                  Hello Andri,

                                  Thank you for contacting us.

                                  I couldn't reproduce this issue on my side. Here is a screencast that illustrates my attempts:

                                  There, you can see that the first expansion of the 'h' template at the top of the file adds the header, while the second expansion does not do anything.

                                  Please clarify how you create the headers:
                                  - using the 'h' template;
                                  - using the "Add Copyright Header" code action (via the Light Bulb menu);
                                  - using the "Add copyright header" code cleanup rule and running Code CleanUp (via code action or via saving file).

                                  It would be also helpful if you provide the following information:
                                  - CodeRush settings (from "%AppData%\CodeRush\Settings");
                                  - CodeRush log files (from "%LocalAppData%\CodeRush\Logs").

                                  I look forward to your response.

                                • Andri B. 06.26.2019

                                  Hey Pavel,

                                  I could reproduce the behaviour you described in your test/video on my machine, this works properly for me. However, i'm using the "Add copyright header" from the code cleanup via saving and not manually. I retested it with older headers and with new headers and it always updates the header.

                                  Additionally, i implemented a rule, which should convert all var-types to the explicit type (e.g. string). This works somewhat fine, but it adds the fully qualified name for Lists, but not for normal variables.


                                  var test = new List<string>() { "asdf", "asdf2", "asdf3" }; // gets converted to global::System.Collections.Generic.List<string> test = new List<string> { "asdf", "asdf2", "asdf3" };


                                  var test = "asdf";

                                  is convertet to

                                  string test = "asdf";

                                  when i save. Is there a option in CodeRush i set wrong?

                                  Thanks for the help


                                • Pavel A (DevExpress) 06.27.2019

                                  Hello Andri,

                                  Thank you for the clarification and providing the requested information.
                                  I have reproduced this behavior with the "Add copyright header" cleanup rule.
                                  We will research this issue and notify you when we make any progress.

                                  Regarding the issue with the explicit types for local declarations, I've created a separate ticket on your behalf: CodeCleanUp incorrectly generates an explicit type name for the List type.
                                  It has been placed in our processing queue and will be answered shortly.

                                1 Solution

                                Creation Date Importance Sort by