Sysprogs forums › Forums › VisualGDB › Why is my indenting this way?
- This topic has 14 replies, 2 voices, and was last updated 7 years, 1 month ago by support.
-
AuthorPosts
-
November 1, 2017 at 17:27 #12809Ophidian14Participant
I looked around in C++ (VisualGDB) in Tools -> Options -> Text Editor but couldn’t really discern which combination of settings would cause this to work in an expected manner.
November 1, 2017 at 20:01 #12816supportKeymasterHi,
This looks pretty strange. Perhaps some code above is confusing VisualGDB? Can you reproduce the same behavior in an empty file? If not, could you reduce the problem to a specific statement above the cursor that causes this?
November 1, 2017 at 21:09 #12822Ophidian14ParticipantNovember 2, 2017 at 22:05 #12837supportKeymasterHi,
This indeed looks strange. Please try saving and deleting the following registry key:
Computer\HKEY_CURRENT_USER\Software\Sysprogs\VisualGDB\Settings\CppEngine
It should reset VisualGDB settings related to code formatting & indentations.
November 5, 2017 at 00:31 #12854Ophidian14ParticipantOkay, did that. Upon the subsequent launch of Visual Studio I got the popup asking me for “critical settings” and the [x] Show this window at startup, but I still get the indenting from the GIF that I posted.
Also, after doing this, Clang Intellisense basically stopped working and I had to delete the CodeDB, Debug, .DB etc. files before it would start working again.
November 5, 2017 at 18:07 #12858supportKeymasterThanks for trying it and sorry for the inconvenience. VisualGDB might be picking up the setting that causes this from the regular VC++ formatting settings.
Please try exporting them via Tools->Import and Export Settings -> Options->Text Editor->C/C++ and attach them here (or send them via our support page) so that we could try reproducing it on our side.
Another option would be to try exporting all settings and then resetting them. If this helps, please try exporting the settings after reset and comparing the produced files. This should show which settings were different and what setting was causing this.
November 6, 2017 at 22:55 #12867Ophidian14ParticipantI attached what I believe you’re looking for. Please let me know if you need anything else.
November 6, 2017 at 22:55 #12868Ophidian14ParticipantSorry, this post has the attachment.
Attachments:
You must be logged in to view attached files.November 7, 2017 at 05:44 #12870supportKeymasterHi,
Thanks for the exported settings. We have tried loading your settings into our VS2017 test setup, however we could not get the behavior you are demonstrating.
The incorrect formatting could be caused by interference from other plugins. Please try disabling all other extensions via Tools->Extensions and Updates and let us know if you locate a specific extension that causes this. If nothing helps, please try exporting all your Visual Studio settings and then resetting them to defaults.
November 7, 2017 at 17:01 #12875Ophidian14ParticipantOkay, I went back to the completely default settings and the bracketing formatting now “works”, in that it doesn’t produce something completely unexpected. However, you can see that immediately before the autoformat step (that I don’t want), the brackets are “about” to be put in the wrong place, just as before. I’ve attached this exhibit as “Working1.gif”.
I’ve also attached Working2.gif, which shows “my” settings, but in a normal Win32 C++ VS2015 project, using the default Intellisense. This is exactly how I’d like the bracketing to work, if possible.
Is there any way I can get the VisualGDB bracketing to work just like in Working2.gif, using “my” settings?
Attachments:
You must be logged in to view attached files.November 8, 2017 at 05:52 #12878supportKeymasterHi,
It looks like when you go to the new line with VisualGDB, it inserts double indentation, so the logic that is supposed to remove it when ‘{‘ is typed, only removes a half of it.
It also looks like some other VS extension is highlighting the indentation in red color; perhaps the same extension is responsible for inserting extra spaces?
We have also added extra logging to this build: http://sysprogs.com/files/tmp/VisualGDB-5.3.15.1912.msi
Please try re-running the case shown on Working2.gif and post the output of View->Clang IntelliSense Diagnostics Console here. It will explain what is going on.
November 8, 2017 at 17:08 #12891Ophidian14ParticipantSorry, I forgot to mention in my last message that I’m using another extension that highlights errant whitespace in red. However, I tried disabling it and it made no difference.
Here’s a GIF using the new build. The diagnostic window is visible in the animation.
Attachments:
You must be logged in to view attached files.November 8, 2017 at 20:25 #12898supportKeymasterHi,
Thanks for the updated gif. Looks like you don’t have the “Reformat code when ‘}’ is pressed” enabled in the C++ editor settings, so VisualGDB is using an alternate simplified mechanism to layout the brackets.
We have added a workaround to this build that will fix the location of the closing brace: http://sysprogs.com/files/tmp/VisualGDB-5.3.15.1913.msi
November 8, 2017 at 21:26 #12899Ophidian14ParticipantThank you!!! It’s working. Will this workaround persist into the mainline builds? 5.3r6 and beyond?
November 8, 2017 at 22:05 #12900supportKeymasterHi,
Yes, it will be included in the next maintenance release.
-
AuthorPosts
- You must be logged in to reply to this topic.