Skip to content

hover a struct can't show its whole definition,but hover a enum can #17009

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

Closed
ChimeWu opened this issue Apr 4, 2024 · 7 comments · Fixed by #17021
Closed

hover a struct can't show its whole definition,but hover a enum can #17009

ChimeWu opened this issue Apr 4, 2024 · 7 comments · Fixed by #17021
Assignees
Labels
C-support Category: support questions

Comments

@ChimeWu
Copy link

ChimeWu commented Apr 4, 2024

截图 2024-04-04 11-17-11
截图 2024-04-04 11-16-31

@ChimeWu ChimeWu added the C-support Category: support questions label Apr 4, 2024
@roife
Copy link
Member

roife commented Apr 5, 2024

You can adjust the number of fields displayed when hovering by setting rust-analyzer.hover.show.structFields (default: null, indicating no fields will be displayed).

See https://rust-analyzer.github.io/manual.html#configuration

@Veykril
Copy link
Member

Veykril commented Apr 5, 2024

On that note we probably want a setting for enum variants as well

@roife
Copy link
Member

roife commented Apr 5, 2024

Currently, we don't display the fields of the struct by default. Perhaps we could set a default value for it (for example, 8)? So that users will discover this feature.

And considering that we can implement this for both enum, and union, should we combine them into a single setting?

@ChimeWu
Copy link
Author

ChimeWu commented Apr 5, 2024

Thank you for your help! I'm a student and I'm learning rust , rust-analyzer helps me a lot,thank you::smile::

@ChimeWu
Copy link
Author

ChimeWu commented Apr 5, 2024

Currently, we don't display the fields of the struct by default. Perhaps we could set a default value for it (for example, 8)? So that users will discover this feature.

And considering that we can implement this simultaneously for both enum, and union, should we combine them into a single setting?

大佬,萌新求带

@roife
Copy link
Member

roife commented Apr 5, 2024

大佬,萌新求带

It's recommended to use English for GitHub Issues discussions to keep things clear and inclusive. For discussions regarding off-topic or private matters, please communicate via email. Thanks!

@roife
Copy link
Member

roife commented Apr 5, 2024

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-support Category: support questions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants