sensebox / React-Ardublockly

This repository contains the new senseBox learn- and programming environment powered by google Blockly and React
Apache License 2.0
2 stars 7 forks source link

Formatter does not work properly with indentation of if-else. #353

Open BjoernLuig opened 1 week ago

BjoernLuig commented 1 week ago

Current behaviour

Formatter does not work properly. For example:

void loop() {
  solar_update_SB041();
  if (( solar_panel_voltage > 2)) {
    deep_sleep_and_restart(30 * 60000);}
    else {
      deep_sleep_and_restart(12 * 3600000);}

    }

Expected behaviour

Proper indentation of if-else and no space infront of solar_panel_voltage. For example:

void loop() {
  solar_update_SB041();
  if ((solar_panel_voltage > 2)) {
    deep_sleep_and_restart(30 * 60000);
  } else {
    deep_sleep_and_restart(12 * 3600000);
  }
}
mariopesch commented 1 week ago

Is the code generated via blocks?

BjoernLuig commented 1 week ago

Yes and using the format button in the code editor doesn't work either.