formatting with visualGDB 5 is REALLY crap! (sorry..)

Sysprogs forums Forums VisualGDB formatting with visualGDB 5 is REALLY crap! (sorry..)

Viewing 15 posts - 1 through 15 (of 29 total)
  • Author
    Posts
  • #7121
    Martijn
    Participant

    I like the new intellisense features in VisualGDB 5, but it give me also new formatting options.

    And these options are preventing me from using the new intellisense features at all, because I only can enable all at once or none.

    I would REALLY like the use the formatting options visual studio gives me by default. They give me much more freedom then when I use the new VisualGDB version.

    But I actually like a lot of options in visualGDB, but I really hate that visualGDB broke my formatting options and I can’t get them the way I want!

    PLEASE make the formatting options an optional feature to use. This is really holding me back to use the full capability of visualGDB.

     

    edit: It is mainly the indentation of braces after an if statement. I don’t want indentation there!

    • This topic was modified 9 years ago by Martijn.
    #7124
    MartinBonner
    Participant

    Ah!  I had wondered what was breaking my formatting.  Mixing formatting up with IntelliSense is a mistake anyway, and not allowing people to control it is really poor.

    #7127
    support
    Keymaster

    Hi,

    The Clang IntelliSense includes formatting because switching the IntelliSense engine actually also disables the original formatting. Normally VisualGDB should import your VS settings and format your code accordingly. If it does not happen, we will certainly fix this. Could you give an example of a code formatted with our IntelliSense, with original IntelliSense and a screenshot of your VS indentation settings? This should allow us reproduce the problem and fix it.

    #7147
    MartinBonner
    Participant

    As an example of the sort of problem I am getting, my usual style of formatting is:

        if (test)
        {
            foo();
        }
    

    However, with Clang intellisense, as soon as I hit “{” on a new line, it gets indented to:

        if (test)
            {
    

    I know there are some people that like that style of indenting, but I AM NOT ONE OF THEM!

    #7151
    support
    Keymaster

    Hi,

    The brace formatting is controlled by a Visual Studio setting under Tools->Options->Text Editor->C/C++->Formatting->Indentation->Indent Braces:

    Please double-check that it’s not enabled for you. If it is disabled, but VisualGDB still formats the code incorrectly, please let us know which version of Visual Studio you are using so that we could suggest further diagnostic steps.

    #7153
    MartinBonner
    Participant

    Yes it is clear.  The Visual Studio information is appended to this message.

    The problem appears to be that when I type

    if (a)<ENTER>

    it is formatted as:

    if (a)
        <caret here>

    (whichever Intellisense is active).  If I then type “{“, the native Intellisense undoes the indent, but Clang doesn’t (both insert the trailing “}”.  So I get either

    if (a)
    {}

    or

    if (a)
        {}

    If I then start typing new lines of code, I get another level of indentation from the {, so Clang looks like:

    if (a)
        {
            b;
        }

    (Any differences between this report and the previous one, boil down to me actually looking at what is on the screen, rather than mis-remembering.  Sorry!)

     

    #7157
    support
    Keymaster

    Hi,

    Thanks, that explains it. The Clang IntelliSense updates the bracket indentation when it sees both the opening and the closing bracket. By default when you type ‘{‘, the IntelliSense automatically inserts the ‘}’ and formats both of them according to your settings. Looks like you have disabled this feature via Tools->Options->Text Editor->C/C++ (VisualGDB)->Advanced->Typing Assist->Auto-match brackets.

    We recommend enabling it back to get better formatting. We have also added a fix to the upcoming v5.1 version that will automatically un-indent the braces when bracket matching is disabled. Let us know if you want to try a pre-release build with this fix.

    #7163
    MartinBonner
    Participant

    Sorry, nope.  Auto-match brackets is set to “True”.

    #7167
    support
    Keymaster

    OK, strange. Please try this build: http://sysprogs.com/files/tmp/VisualGDB-5.1.0.581.msi

    Open the Clang IntelliSense diagnostics console, clear it, type the opening brace and observe the console output. Does it mention anything about the event being suppressed?

    We have also added a fallback mechanism that should fix the indentation even if the auto-pairing did not get invoked.

    #8676
    jimP
    Participant

    Was this issue ever resolved?  I am having a similar issue.  It looks like when smart indenting is turned on VisualGDB seems to override ‘Indent namespace contents’ under C/C++->Formatting->Indentation. So every time I hit <Enter> my cursor is automatically tabbed while I am inside the namespace block.

     

     

     

    • This reply was modified 8 years, 3 months ago by jimP.
    #8681
    support
    Keymaster

    Hi,

    We have just rechecked that and confirm that the namespace content indentation follows the generic “indent braces” setting. We have fixed it in this build: http://sysprogs.com/files/tmp/VisualGDB-5.2.5.954.msi

    #8686
    jimP
    Participant

    That seems to have fixed it.  Thanks!

    #10934
    thedixon
    Participant

    Pardon for pulling out old topic, but I am confused by it. Currently VS behaves like so:

    when I type namespace asdf {    and hit enter, it goes to the column 1 (I have indent namespace contents set to no). But after I finish typing the codeline and type finishing semicolon, line gets spacing inserted in front.

    goes from this

    namespace asdf {

    some_code

    to this

    namespace asdf {

    [space inserted here]some_code;

    How can I fix it, I don’t want content of my namespaces to be indented.

     

    • This reply was modified 7 years, 7 months ago by thedixon.
    #10938
    support
    Keymaster

    Hi,

    Thanks, looks like our bug. Please try this build: http://sysprogs.com/files/tmp/VisualGDB-5.2.16.1462.msi

    #10952
    thedixon
    Participant

    Confirmed fixed

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