FuelLabs / sway

🌴 Empowering everyone to build reliable and efficient smart contracts.
https://docs.fuel.network/docs/sway/
Apache License 2.0
62.81k stars 5.35k forks source link

SwayFmt removes comment in configuration block #4966

Open Braqzen opened 1 year ago

Braqzen commented 1 year ago

Version 0.44.0

script;

use std::{constants::ZERO_B256, vm::evm::evm_address::EvmAddress};

configurable {
    // SIGNER: EvmAddress = EvmAddress::from(ZERO_B256),
    SIGNER: EvmAddress = EvmAddress {
        value: ZERO_B256,
    },
}

fn main() {}

Run forc fmt and the commented out SINGER will be removed.

Note: If you change the comment // into a doc comment /// then the doc comment will not be removed.

Unsure if bug or some new design decision has taken place that I am unaware of.

brandonsurh commented 9 months ago

Is there any word on what the desired behavior of this is?

Braqzen commented 9 months ago

Is there any word on what the desired behavior of this is?

Formatting should not remove comments. Unsure if this is still an issue in the latest releases.