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

column macro possibly in conflict with core column macro #2306

Closed
2 tasks done
CristianKerr opened this issue Feb 28, 2024 · 5 comments
Closed
2 tasks done

column macro possibly in conflict with core column macro #2306

CristianKerr opened this issue Feb 28, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@CristianKerr
Copy link

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

In RustRover (new ide for rust from JetBrains), the macro in iced_widget::column collides (probably) with core::column macro and causes issues with code navigation and highlighting (screenshot below). While this is not an issue of Iced itself, I would suggest to avoid these macros to have the same name (or any macros to be named the same as the core macros) as it may have unintended consequences now and in the future.

For simplicity I would suggest to rename the macro to "col" as it would pair nicely with "row" as a short macro. This abbreviation is well known between other languages (like HTML) as well.

Do not get me wrong, I think short but full names have their merit, but there are cases like this where I think it would be prudent to avoid it.

I have just filed this bug to Jetbrains. Feel free to look at it in detail as it includes also a minimal example and following screenshot:
Screenshot from 2024-02-28 15-25-42

What is the expected behavior?

There are no side effects of this same naming.

Version

crates.io release

Operating System

Linux

Do you have any log output?

No response

@CristianKerr CristianKerr added the bug Something isn't working label Feb 28, 2024
@hecrj
Copy link
Member

hecrj commented Feb 28, 2024

This is most likely a rust-analyzer issue. It was fixed a while ago: rust-lang/rust-analyzer@9b33874

Try updating it.

@hecrj
Copy link
Member

hecrj commented Feb 28, 2024

For simplicity I would suggest to rename the macro to "col" as it would pair nicely with "row" as a short macro. This abbreviation is well known between other languages (like HTML) as well.

I don't like abbreviations. I think they add subconscious overhead and increase the learning barrier.

@CristianKerr
Copy link
Author

CristianKerr commented Feb 28, 2024

Thanks for the tip. I actually don't think I can do anything for that, because I think its built in the RustRover, there is no option or plugin like this.

Anyway this issue is rather about evaluating whether it would be a good idea to rename the column macro 😊

I don't like abbreviations. I think they add subconscious overhead and increase the learning barrier.

Some abbreviations are well established, like e.g. col, though :)

@hecrj
Copy link
Member

hecrj commented Feb 28, 2024

Anyway this issue is rather about evaluating whether it would be a good idea to rename the column macro 😊

I see! We use issues for bug reports only. I recommend you to start a discussion either over our Discord server or our Discourse forum.

Closing, since this isn't really a bug!

@hecrj hecrj closed this as completed Feb 28, 2024
@CristianKerr
Copy link
Author

Understood, I should have realized, my appologies :) And thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants