Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defect: Candid formatting is dodgy #4946

Open
crusso opened this issue Mar 13, 2025 · 0 comments
Open

defect: Candid formatting is dodgy #4946

crusso opened this issue Mar 13, 2025 · 0 comments
Labels
P3 low priority, resolve when there is time

Comments

@crusso
Copy link
Contributor

crusso commented Mar 13, 2025

  • no space before :
  • service types in arguments are formatted strangely

see test/mo-idl/ok/named.did.ok

service : {
  /// anon
  anon: (nat, nat) -> (nat); // no space before `:`
  /// escape candid keywords
  escape: ("int": int, "bool": bool, "service": service {  // <- weird break                                                                                
                                                }) -> ("int": int, "bool":
   bool, "service": service { // <- weird break
                    });
  /// function arg/ret
  f: (named: func (x: nat, y: nat) -> (r: nat)) -> (unamed:  // <- weird break
   func (nat, nat) -> (nat));
  /// actor arg/ret
  g: (A:
   service {
     anon: (nat, nat) -> (nat);
     named: (x: nat, y: nat) -> (r: nat);
   }) ->
   (service {
      anon: (x: nat, y: nat) -> (r: nat);
      named: (nat, nat) -> (nat);
    });
  /// named
  named: (x: nat, y: nat) -> (r: nat);
  /// record
  "record": (record {
               x: nat;
               y: nat;
             }) -> (record {r: nat;});
}

@crusso crusso added the P3 low priority, resolve when there is time label Mar 13, 2025
@crusso crusso changed the title candid formatting is dodgy defect: Candid formatting is dodgy Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 low priority, resolve when there is time
Projects
None yet
Development

No branches or pull requests

1 participant