Formatting a file always inserts additional space

Sysprogs forums Forums VisualGDB Formatting a file always inserts additional space

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #31154
    curtis.hendrix
    Participant

    Whenever I do a apply formatting to file (CTL+K, CTL+D), an additional space always gets added in between the end of the code line and the start of the comment, when comments are on the same line.

    For example, if I start with this code:

    pac5xxx_uart_int_enable_THREI2(PAC55XX_UARTB, 0); // Disable transmit interrupt
    pac5xxx_uart_int_enable_RDAI2(PAC55XX_UARTB, 1); // Enable receive data interrupt for next incoming message

    Then format the file, I wind up with

    pac5xxx_uart_int_enable_THREI2(PAC55XX_UARTB, 0);  // Disable transmit interrupt
    pac5xxx_uart_int_enable_RDAI2(PAC55XX_UARTB, 1);  // Enable receive data interrupt for next incoming message

    If I format the file 20 times, I wind up with

    :

    pac5xxx_uart_int_enable_THREI2(PAC55XX_UARTB, 0);                    // Disable transmit interrupt
    pac5xxx_uart_int_enable_RDAI2(PAC55XX_UARTB, 1);                    // Enable receive data interrupt for next incoming message

    I cannot figure out a way to disable this behavior.  I only have this problem with VisualGDB projects.  VC++ and C# projects work fine.  This is ONLY with VisualGDB projects.

    #31155
    curtis.hendrix
    Participant

    This is only with C++ style comments (//).  C style comments (/**/) at the end of a line do no exhibit the issue.

    #31164
    support
    Keymaster

    Hi,

    Most likely, you have selected some combination of settings that breaks either the VisualGDB formatting logic, or some other extension.

    First of all, please double-check that you are using the VisualGDB’s Clang IntelliSense, and also recheck whether you are using Clang-format or Sysprogs Formatting Engine as described here.

    If you are using Clang-format, please share your .clang-format file so that we could recheck what is going on.

    If you are using SysprogsFormat, please try resetting all VS-level settings via Tools->Import and Export Settings (you can save them beforehand). If it doesn’t help, please try renaming the HKEY_CURRENT_USER\SOFTWARE\Sysprogs\VisualGDB\Settings\CppEngine key in registry.

    If this fixes the problem, please try restoring the original settings one-by-one. If you can point to a specific combination of settings that triggers this problem, we will be happy to investigate it further.

    #31185
    curtis.hendrix
    Participant

    I changed the project setting to use the Clang-format (under VisualGDB Project Properties->IntelliSense Settings->Code formatting settings), and the issue went away.  I set it back to Default (legacy), and the issue came back.

    I reset all my settings in Visual Studio to C++, and the issue remained.

    I also renamed the registry key, rebooted, and the issue remained.

    I recently got a new computer, and this issue shows up on both systems.  Both are running Windows 10, but the new computer is using VS 2019.  The old computer is using VS 2017

    #31187
    support
    Keymaster

    Hi,

    If the issue is present with the default settings, it’s likely caused by some special characters in the source files. Please try reproducing it on a new project created from scratch, and then try attaching a .zip file with the entire project here, so that we could try reproducing it on our side.

    #31190
    curtis.hendrix
    Participant

    I’ve created a new project and it also has this issue.  I did notice this only happens when Advanced Clang Intellisense is selected.  This does not happen with the VC++ IntelliSense.

    Unfortunately I cannot upload the project due to size limitation on the forum.  The zipped project folder is 11MB.  I created a new nRF52832 project with the S132 softdevice, and used the LED Blink example.  The only setting I changed from default was to select the Advanced Clang Intellisense.

    #31191
    support
    Keymaster

    Hi,

    No problem. Please try uploading the zip file with the entire project to a file sharing service (e.g. OneDrive/DropBox) and posting a link here.

    #31192
    curtis.hendrix
    Participant
    #31197
    support
    Keymaster

    Hi,

    Sorry, we have tried reproducing this on the latest VisualGDB build, but it worked just fine.

    Please try updating to the latest VisualGDB 5.6 Beta 4. If the problem persists, please try changing your tab settings (e.g. tab size = 4, keep tabs) and let us know if this changes the behavior.

    Also please try disabling all other VS extensions. One of them might be interfering with the VisualGDB’s code formatting logic.

    #31226
    curtis.hendrix
    Participant

    Update to VisualGDB 5.4 Beta 4 (Build 4225).  Same issue.

    Set the tab settings to 4, keep tabs.  Same issue.

    I also disabled all the extensions (except VisualGDB).  Same issue.

    #31228
    support
    Keymaster

    Sorry, unless we can reproduce the issue on our side, we will not be able to address it. We will keep an eye out for other users reporting similar behavior and will fix it as soon as we are able to reproduce it.

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.