Why is my indenting this way?

Sysprogs forums Forums VisualGDB Why is my indenting this way?

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #12809
    Ophidian14
    Participant

    https://imgur.com/a/GPPnp

    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.

    #12816
    support
    Keymaster

    Hi,

    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?

    #12822
    Ophidian14
    Participant

    Here it is in an empty file:

    https://imgur.com/a/1DotJ

     

    First brace is okay, second brace not.

    #12837
    support
    Keymaster

    Hi,

    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.

    #12854
    Ophidian14
    Participant

    Okay, 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.

    #12858
    support
    Keymaster

    Thanks 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.

    #12867
    Ophidian14
    Participant

    I attached what I believe you’re looking for.  Please let me know if you need anything else.

    #12868
    Ophidian14
    Participant

    Sorry, this post has the attachment.

    Attachments:
    You must be logged in to view attached files.
    #12870
    support
    Keymaster

    Hi,

    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.

    #12875
    Ophidian14
    Participant

    Okay, 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.
    #12878
    support
    Keymaster

    Hi,

    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.

    #12891
    Ophidian14
    Participant

    Sorry, 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.
    #12898
    support
    Keymaster

    Hi,

    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

     

    #12899
    Ophidian14
    Participant

    Thank you!!!  It’s working.  Will this workaround persist into the mainline builds?  5.3r6 and beyond?

    #12900
    support
    Keymaster

    Hi,

    Yes, it will be included in the next maintenance release.

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