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

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

Viewing 14 posts - 16 through 29 (of 29 total)
  • Author
    Posts
  • #11783
    Rumchiller
    Participant

    Again another pull 🙂

     

    I have a problem with the visual studio auto formatting feature when formatting the whole document.

    Let’s assume the following:

     

    /**
    * \brief Initializes Uart in 8-bit mode
    * without parity bit.
    * \param baudrate The Baudrate.
    * \param s The Stopbit.
    */
    Uart1(uint32_t baudrate,
    StopBit s);

    /**
    * \brief Initializes Uart in 8-bit mode
    * with parity bit.
    * \param baudrate The Baudrate.
    * \param s The Stopbit.
    * \param p The Parity.
    */
    Uart1(uint32_t baudrate,
    StopBit s,
    Parity p);

    Now, when I do auto format I get this:

    /**
    * \brief Initializes Uart in 8-bit mode
    * without parity bit.
    * \param baudrate The Baudrate.
    * \param s The Stopbit.
    */
    Uart1(uint32_t baudrate,
    StopBit s);
    <p style=”padding-left: 30px;”>/**
    * \brief Initializes Uart in 8-bit mode
    * with parity bit.
    * \param baudrate The Baudrate.
    * \param s The Stopbit.
    * \param p The Parity.
    */</p>

    Uart1(uint32_t baudrate,
    StopBit s,
    Parity p);

     

    After a new click on auto format:

    /**
    * \brief Initializes Uart in 8-bit mode
    * without parity bit.
    * \param baudrate The Baudrate.
    * \param s The Stopbit.
    */
    Uart1(uint32_t baudrate,
    StopBit s);
    <p style=”padding-left: 60px;”>
    * \brief Initializes Uart in 8-bit mode
    * with parity bit.
    * \param baudrate The Baudrate.
    * \param s The Stopbit.
    * \param p The Parity.
    */</p>
    Uart1(uint32_t baudrate,
    StopBit s,
    Parity p);

    On each auto format the comment is intented further. This happens always when I’m working with overloaded methods.

    Could you help me with that problem?

     

    PS: Terrible WordPress… In short: The second block comment is intended to right on each auto format click. When I auto format the document a hundred times, the block moves 100 intends to the right.

    • This reply was modified 7 years, 4 months ago by Rumchiller.
    • This reply was modified 7 years, 4 months ago by Rumchiller.
    • This reply was modified 7 years, 4 months ago by Rumchiller.
    • This reply was modified 7 years, 4 months ago by Rumchiller.
    #11788
    support
    Keymaster

    Hi,

    Please try using the latest VisualGDB 5.3 Preview 3 that contains several improvements to comment formatting.

    #11795
    Rumchiller
    Participant

    I am using already 5.3 Preview 3 (build 1672). In addition, sometimes comments in functions and methods were also intending.

     

    PS: Using VS2017 with all updates. Unfortunately I have this problem since I am using VisualGDB.

    • This reply was modified 7 years, 4 months ago by Rumchiller.
    #11807
    support
    Keymaster

    Hi,

    Thanks, we have tried reproducing this behavior, but could not get any inconsistencies with the comments. Please try attaching the source file to the message (instead of copy-pasting it) to preserve the original formatting and let us know the exact steps to reproduce it (e.g. select Edit->Advanced->Format Document) so that we could look into this.

    #11810
    Rumchiller
    Participant

    I am having big problems with auto formatting the whole code. Sometimes all is fine, but most of the time I have to do “format selected text”.  The behaviour is the same with hokey or  Edit->Advanced->Format Document.

     

    I attached an example code.

     

    An option in a future version of VisualGDB to deactivate the formatting of comments would be absolutley sufficient for my purposes.

     

    PS: I had to rename .hpp to .h for the upload. But it makes no difference for formatting.

    • This reply was modified 7 years, 4 months ago by Rumchiller.
    • This reply was modified 7 years, 4 months ago by Rumchiller.
    Attachments:
    You must be logged in to view attached files.
    #11814
    Rumchiller
    Participant

    Found another problem:

    When autoformatting it also opens the closed brackets, e.g. when Uart1 class is closed, then autoformat opens it again.

    #11815
    Rumchiller
    Participant

    Is it proper that the comments are not collapesable?

    #11816
    Rumchiller
    Participant

    Why VisualGDB has its own Formatter? Does the VisualStudio Formatter not working properly?

    #11823
    support
    Keymaster

    Hi,

    Thanks for the repro. It looks like VisualGDB is getting confused by an unexpected combination of tabs and spaces in your code.

    Please try resetting the indentations (by selecting all text and holding Shift-Tab) and then reformatting the document. This should set the indentations properly.

    Alternatively you can switch from the Clang-based IntelliSense engine to the regular VS IntelliSense engine via VisualGDB Project Properties to get the regular VS behavior (please note that the VS IntelliSense engine often gets confused by GCC-specific constructs in the embedded code and hence may produce less accurate results).

    The comment collapsing is not supported yet, sorry.

    #11826
    Rumchiller
    Participant

    Yeah, when the indentation is resetted, a single reformat is working. But I have to reset the indentation each time before reformating.

    Regarding the native IntelliSense engine, working with it is impossible due to the errors of it.

    #11842
    support
    Keymaster

    Hi,

    OK, thanks, we will reinvestigate this within the next 5-10 business days after releasing Preview 5.

    #11858
    Rumchiller
    Participant

    I think I found the problem:

     

    Uart(Interface interface,
    uint32_t baudrate,
    StopBit s);

    -> comment after this moves to the right.

     

    Uart(Interface interface, uint32_t baudrate, StopBit s);

    -> after that the formatting behaves normally.

     

    It’s maybe not too much work to correct this. And I also think, most problems I got with autoformatting are caused by this.

    • This reply was modified 7 years, 3 months ago by Rumchiller.
    #11971
    support
    Keymaster

    Hi,

    Yes, the problem happened because the fine-grained indentation of the function arguments happened on the different level than the coarse-grained indentation of the statements.

    We have fixed this in the following build: http://sysprogs.com/files/tmp/VisualGDB-5.3.5.1708.msi

    #12100
    Rumchiller
    Participant

    With preview 6 it’s now working perfectly 🙂

    Thanks!

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