Bug Report T708969
Visible to All Users

Code Cleanup - 'Remove all comments' rule should skip task-based comments

created 6 years ago (modified 6 years ago)

Hello,

I know it sounds like a joke, but:

When using CodeCleanup with option remove all comments, excluding XML comments (in a VB project)

Does it make sense to remove task based comments in a method? They are removed…
( you can't use XML comments in a method, so there would be no possibility for comments in methods at all…)
Also I thought at least comments at the end of a line should not be removed (?) I found a ticked which I don't find anymore with a fix for that (in version 17 something as far as I remember…?)

Thanks a lot,
Franz

Edit: the ticket I didn't find before is: T538172

Comments (2)

    As the ticket T538172 was probably targeting another issue and I also saw a request for 'detect commented out code' I think I should change this in a feature request:

    Actually I would love to remove many of commented out code in an old project but keep all task based comments.
    So far I didn't find a possibility to do this with the CodeCleanup feature.

    Thanks again,
    Franz

    DevExpress Support Team 6 years ago

      Hi Franz,

      Thank you for pointing out this issue. We agree that the "Remove all comments" rule should not affect on task based comments. We are working to correct it.

      As for the ticket that you mention, it related to the "Convert to string.Empty" rule. So, the Code Cleanup removes comments at the end of a line if the "Remove all comments" rule is enabled. We don't plan to change this behavior.

      Answers approved by DevExpress Support

      created 6 years ago

      We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

      Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

        Show previous comments (2)
        DevExpress Support Team 6 years ago

          Hi Franz,

          We have corrected the "Remove all comments" code cleanup rule in such a way that it doesn't remove comments from the Task List window anymore. It applies to comments that start case-insensitively with standard and custom tokens.

          The check for special comments in the Rich Comments is case-insensitive now as well. Take note that custom tokens that are defined in Visual Studio are not counted in the Rich comments feature.

          These changes will be available starting with CodeRush 18.2.8. We have prepared a special build with these changes that you can use now: DevExpress.CodeRush.Roslyn-18.2.7.19052.vsix.

            Hi Alexander,

            thank you very much!!
            It's already a big help…

            I noticed that the rich comments feature already works with custom tokens.
            But… if you have NOTE as a custom token and this code:
               '#NOTE This file is auto-generated; do not modify it directly.  To make changes,
                'NOTE or if you encounter build errors in this file, go to the Project Designer
                'NOTE (go to Project Properties or double-click the My Project node in
                'NOTE Solution Explorer), and make changes on the Application tab.
                Public Sub New()
                    InitializeComponent()
                End Sub
            after cleanup you get one line with all notes and at the end of this line you find the Public Sub New()

            But I know it's still a beta… again: thank you so much,
            Franz

            DevExpress Support Team 6 years ago

              Hi Franz,

              You are welcome.

              To process the issue from your last post more efficiently, I've created a separate ticket on your behalf: Code Cleanup - The 'Remove all comments' rule removes line breaks between task-based comments. Let's continue our discussion there.

              Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

              Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.