Skip to content

C++ RobotBuilder adds extra lines VS Code removes whitespace #383

@jmullins16

Description

@jmullins16

An low priority inconvenience, but wanted to document it.

When using an IDE that removes whitespace, some of the lines that RobotBuilder segments are changed. When RobotBuilder runs again, it updates because the existing snippet no longer matches what RB wants to insert. Specifically, it looks like RB puts CRLF and a single space on some lines in this segment. VS Code trims the whitespace (at least ours does) when that file is edited, and then RB puts it in again on the next pass. It generates a lot of confusing changes in git for the students whenever they touch a file.

It would be nice if RB did not ever leave trailing whitespace, and even better if it never generated code with more than a single blank line between statements or BEGIN/END guards.

    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS
    SetSubsystem("Drivetrain");

 
 

 
 

 AddChild("Diff Drive", &m_diffDrive);
 m_diffDrive.SetSafetyEnabled(true);
m_diffDrive.SetExpiration(0.1);
m_diffDrive.SetMaxOutput(1.0);


 
 

 
 

 AddChild("Shifter", &m_shifter);
 

 
 

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions