Bug Report T1201505
Visible to All Users

Code Cleanup - Compilation error occurs because of an unpaired #endregion directive added at the end of the file

created a year ago

When "Format on Save" is enabled in a Blazor project, CodeRush consistently and arbitrarily adds multiple unpaired #endregion tags to the document. This forces me to stop my work, locate the tags, and delete them. I have been forced to turn off this feature. I love this feature, but I cannot get it to work. Can you provide assistance?

Show previous comments (4)

    Thank you for your assistance.

    Below are the installed extensions. Taken from the Help->About MS Visual Studio.

    Microsoft Visual Studio Community 2022
    Version 17.8.0
    VisualStudio.17.Release/17.8.0+34309.116
    Microsoft .NET Framework
    Version 4.8.09032

    Installed Version: Community

    ADL Tools Service Provider 1.0
    This package contains services used by Data Lake tools

    ASA Service Provider 1.0

    ASP.NET and Web Tools 17.8.352.38654
    ASP.NET and Web Tools

    Azure App Service Tools v3.0.0 17.8.352.38654
    Azure App Service Tools v3.0.0

    Azure Data Lake Tools for Visual Studio 2.6.5000.0
    Microsoft Azure Data Lake Tools for Visual Studio

    Azure Functions and Web Jobs Tools 17.8.352.38654
    Azure Functions and Web Jobs Tools

    Azure Stream Analytics Tools for Visual Studio 2.6.5000.0
    Microsoft Azure Stream Analytics Tools for Visual Studio

    C# Tools 4.8.0-7.23558.1+e091728607ca0fc9efca55ccfb3e59259c6b5a0a
    C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

    CodeRush for Roslyn 23.1.5.0
    DevExpress CodeRush for Roslyn package.

    CodeRush for Roslyn Tool Windows 23.1.5.0
    DevExpress CodeRush for Roslyn Tool Windows package.

    Common Azure Tools 1.10
    Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

    Extensibility Message Bus 1.4.39 (main@e8108eb)
    Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

    Microsoft Azure Hive Query Language Service 2.6.5000.0
    Language service for Hive query

    Microsoft Azure Stream Analytics Language Service 2.6.5000.0
    Language service for Azure Stream Analytics

    Microsoft JVM Debugger 1.0
    Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

    Mono Debugging for Visual Studio 17.8.17 (957fbed)
    Support for debugging Mono processes with Visual Studio.

    NuGet Package Manager 6.8.0
    NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

    Razor (ASP.NET Core) 17.8.3.2353105+f0a326f3e15b2370371693a76fd379635387c74d
    Provides languages services for ASP.NET Core Razor.

    SQL Server Data Tools 17.8.119.0
    Microsoft SQL Server Data Tools

    Supercharger 1.14.0.1745
    Extend Visual Studio with CodeMAP, Intelligent Code Flow Lines, Code Highlighters, SuperFind, Rich Code, Magic Comments etc. More info: http://supercharger.tools

    ToolWindowHostedEditor 1.0
    Hosting json editor into a tool window

    TypeScript Tools 17.0.20920.2001
    TypeScript Tools for Microsoft Visual Studio

    Visual Basic Tools 4.8.0-7.23558.1+e091728607ca0fc9efca55ccfb3e59259c6b5a0a
    Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

    Visual F# Tools 17.8.0-beta.23475.2+10f956e631a1efc0f7f5e49c626c494cd32b1f50
    Microsoft Visual F# Tools

    Visual Studio IntelliCode 2.2
    AI-assisted development for Visual Studio.

    VisualStudio.DeviceLog 1.0
    Information about my package

    VisualStudio.Mac 1.0
    Mac Extension for Visual Studio

    VSPackage Extension 1.0
    VSPackage Visual Studio Extension Detailed Info

    Xamarin 17.8.0.155 (d17-8@7042beb)
    Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

    Xamarin Designer 17.8.3.6 (remotes/origin/d17-8@eccf46a291)
    Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

    Xamarin.Android SDK 13.2.2.0 (d17-5/45b0e14)
    Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: d9a6e87
    Java.Interop: xamarin/java.interop/d17-5@149d70fe
    SQLite: xamarin/sqlite/3.40.1@68c69d8
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-5@ca1552d

    PW PW
    Przemyslaw Wlodarczak (DevExpress) a year ago

      Ron,

      Thank you for the list of extensions. Supercharger is the only one that can potentially interact with CodeRush. I will install it and see if I can reproduce the issues.

      PW PW
      Przemyslaw Wlodarczak (DevExpress) a year ago

        Ron,

        I used your settings and managed to reproduce the issue with unwanted #endregion directives. We will fix it. As a workaround, please disable region creation on the Organize Members option page:

        • Open the CodeRush Options window (click the Extensions->CodeRush->Options menu item).
        • Navigate to the Editor->All Languages->Organize Members option page.
        • Find the Public methods group.
        • Clear the Wrap distinct groups in regions checkbox.

        CodeCleanupRegions.png

        Regarding the crash, I created a separate ticket on your behalf: T1202480: CodeRush crashes Visual Studio client. I did it to ease processing of unrelated issues.

        Answers approved by DevExpress Support

        created a year ago

        We have addressed the issue described in this ticket and will include a fix in our next maintenance update. Should you need to apply our fix prior to official release, you can request a hotfix here.

        Important Notes:

        • Hotfixes may be unavailable for Early Access/Beta builds or updates set for release within a week.
        • .NET only: in the NuGet Package Manager, use your personal NuGet feed and check the "Include prerelease" option to view the hotfix package in the "Updates" tab.

          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.