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

Better spanning on generated code #170

Open
hashedone opened this issue Jun 9, 2023 · 1 comment
Open

Better spanning on generated code #170

hashedone opened this issue Jun 9, 2023 · 1 comment
Labels
backlog Items planned to be done, but with no milestone yet enhancement New feature or request errors refactor

Comments

@hashedone
Copy link
Collaborator

We need to use span pointing more. If something goes wrong with this generated function compilation, the compilation error would point to #[contract], while the function is generally generated from the reply function - I think it would be nice to add the proper span for the whole entity with quote_spanned:

quote_spanned! {
  // Where `reply_span` is a span of the whole reply signature
  reply_span=>
    #[#sylvia ::cw_std::entry_point]
    // ...
}

Note that quote_spaned maintains spans of spanned entities you expand (eg if something is wrong with compiling #custom_msg in resp type, error about that would actually point to the ident we created it from.

Originally posted by @hashedone in #156 (comment)

@hashedone hashedone added enhancement New feature or request errors labels Jun 9, 2023
@hashedone hashedone added refactor backlog Items planned to be done, but with no milestone yet labels Feb 20, 2024
@hashedone
Copy link
Collaborator Author

First do #98

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Items planned to be done, but with no milestone yet enhancement New feature or request errors refactor
Projects
None yet
Development

No branches or pull requests

1 participant