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

Outdated links in error message #1059

Open
Bogay opened this issue Oct 15, 2023 · 3 comments
Open

Outdated links in error message #1059

Bogay opened this issue Oct 15, 2023 · 3 comments
Labels

Comments

@Bogay
Copy link
Contributor

Bogay commented Oct 15, 2023

Copied from discord:

Found outdated links in the error message. Perhaps the version string could be extracted from Cargo.toml at compile time to make it more consistent?

fn generate_error_with_docs(span: proc_macro2::Span, message: &str) -> syn::Error {
    syn::Error::new(
        span,
        format!(
            "{message}\n\texpecting #[variant(...)]. See documentation:\n\thttps://docs.rs/gdnative/0.9.0/gdnative/core_types/trait.ToVariant.html#field-attributes"
        ),
    )
}

fn generate_error_with_docs(span: proc_macro2::Span, message: &str) -> syn::Error {
syn::Error::new(
span,
format!(
"{message}\n\texpecting #[variant(...)]. See documentation:\n\thttps://docs.rs/gdnative/0.9.0/gdnative/core_types/trait.ToVariant.html#field-attributes"
),
)
}

another one with similar signature:

fn generate_error_with_docs(span: Span, message: &str) -> syn::Error {
syn::Error::new(
span,
format!(
"{message}\n\texpecting #[variant(...)]. See documentation:\n\thttps://docs.rs/gdnative/0.9.0/gdnative/core_types/trait.ToVariant.html#field-attributes"
),
)
}

@Bogay Bogay added the bug label Oct 15, 2023
@Bogay
Copy link
Contributor Author

Bogay commented Oct 15, 2023

Maybe related: #1039

Should we put latest compatible Godot version in Cargo.toml?

@Bogay
Copy link
Contributor Author

Bogay commented Oct 15, 2023

Oh, the links to godot doc are written in doc comments. So it's harder to generate it 🤔

@chitoyuu
Copy link
Contributor

chitoyuu commented Oct 16, 2023

Doc comments are just sugar for #[doc] attributes so they can be generated using proc-macros. I guess we can also do text-based search & replace in the build script but that's much more of a risky option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants