Sysprogs forums › Forums › VisualGDB › Formatting a file always inserts additional space
- This topic has 10 replies, 2 voices, and was last updated 3 years, 1 month ago by support.
-
AuthorPosts
-
August 17, 2021 at 12:36 #31154curtis.hendrixParticipant
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.
August 17, 2021 at 12:37 #31155curtis.hendrixParticipantThis is only with C++ style comments (//). C style comments (/**/) at the end of a line do no exhibit the issue.
August 17, 2021 at 19:20 #31164supportKeymasterHi,
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.
August 20, 2021 at 11:25 #31185curtis.hendrixParticipantI 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
- This reply was modified 3 years, 1 month ago by curtis.hendrix.
August 20, 2021 at 12:14 #31187supportKeymasterHi,
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.
August 23, 2021 at 05:02 #31190curtis.hendrixParticipantI’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.
August 23, 2021 at 08:07 #31191supportKeymasterHi,
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.
August 23, 2021 at 11:02 #31192curtis.hendrixParticipantThe project should be available here:
August 24, 2021 at 13:58 #31197supportKeymasterHi,
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.
August 30, 2021 at 08:26 #31226curtis.hendrixParticipantUpdate 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.
- This reply was modified 3 years, 1 month ago by curtis.hendrix.
August 30, 2021 at 08:43 #31228supportKeymasterSorry, 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.
-
AuthorPosts
- You must be logged in to reply to this topic.