Skip to content

Update Punctuated to handle trailing punctuation #2134

@eureka-cpu

Description

@eureka-cpu

Once #2110 gets merged, we will have handling of punctuated pairs, but it doesn't yet handle trailing punctuation well. Something like:

contract;

abi StorageMapExample {
    #[storage(write,)]fn insert_into_map1(key: u64, value: u64);
}

gets formatted to:

contract;

abi StorageMapExample {
    #[storage(write, )] // <-- notice the comma and trailing space
    fn insert_into_map1(key: u64, value: u64);
}

The same is true for multiple args with a trailing comma like:

contract;

abi StorageMapExample {
    #[storage(write, read, )]
    fn insert_into_map1(key: u64, value: u64);
}

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions