Skip to content

generate! macros fail when WIT files use syntax defined in the WIT book #233

@jvatic

Description

@jvatic

Given a WIT file that contains kebab-case (or otherwise uses the interface syntax defined in the WIT book):

interface hello-world {
  hello-world: func () -> result<string, string>;
}

both host and guest generate! macros fail:

  --> src/app.rs:20:1
   |
20 | / tauri_bindgen_guest_rust::generate!({
21 | |     path: "runner-gui-tauri-commands/hello-world.wit",
22 | | });
   | |__^
   |
   = help: message: called `Result::unwrap()` on an `Err` value:   × unexpected character

Instead I have to change it to not conform to the book at all (so much for syntax highlighting 🙃).

interface hello_world {
  func hello_world() -> result<string, string>
}

I'm assuming this is due to the WIT spec having changed at some point? Are there plans to conform to the most recent WIT spec? (It'd be nice to be able to specify a single WIT file with many funcs and supportive types.)

(Possible duplicate of #124)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions