Sysprogs forums › Forums › VisualGDB › formatting with visualGDB 5 is REALLY crap! (sorry..)
- This topic has 28 replies, 6 voices, and was last updated 7 years, 3 months ago by Rumchiller.
-
AuthorPosts
-
July 22, 2017 at 16:49 #11783RumchillerParticipant
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.
July 22, 2017 at 19:18 #11788supportKeymasterHi,
Please try using the latest VisualGDB 5.3 Preview 3 that contains several improvements to comment formatting.
July 22, 2017 at 22:24 #11795RumchillerParticipantI 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.
July 24, 2017 at 03:03 #11807supportKeymasterHi,
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.
July 24, 2017 at 14:14 #11810RumchillerParticipantI 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.July 24, 2017 at 17:30 #11814RumchillerParticipantFound another problem:
When autoformatting it also opens the closed brackets, e.g. when Uart1 class is closed, then autoformat opens it again.
July 24, 2017 at 19:58 #11815RumchillerParticipantIs it proper that the comments are not collapesable?
July 24, 2017 at 20:17 #11816RumchillerParticipantWhy VisualGDB has its own Formatter? Does the VisualStudio Formatter not working properly?
July 25, 2017 at 05:37 #11823supportKeymasterHi,
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.
July 25, 2017 at 18:35 #11826RumchillerParticipantYeah, 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.
July 27, 2017 at 00:09 #11842supportKeymasterHi,
OK, thanks, we will reinvestigate this within the next 5-10 business days after releasing Preview 5.
July 30, 2017 at 19:00 #11858RumchillerParticipantI 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.
August 7, 2017 at 19:47 #11971supportKeymasterHi,
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
August 17, 2017 at 20:35 #12100RumchillerParticipantWith preview 6 it’s now working perfectly 🙂
Thanks!
-
AuthorPosts
- You must be logged in to reply to this topic.