Skip to content

Hiding very long type annotations #7527

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
arturoc opened this issue Feb 2, 2021 · 3 comments
Closed

Hiding very long type annotations #7527

arturoc opened this issue Feb 2, 2021 · 3 comments

Comments

@arturoc
Copy link

arturoc commented Feb 2, 2021

I find that sometimes types generated from macros and similar get too long for the type annotations. For example:

image

Rather than help they make the code less readable and since they are so long they are not immediately useful as a short type that is very easily readable would be.

Perhaps there should be a limit of characters to show. Since you can always see the type by hovering the mouse over the declaration I think it would help uncluttering the view in certain types of code.

If a certain type is longer than a number of characters it would be completely hidden or perhaps abbreviated to that number of characters plus ...

@Veykril
Copy link
Member

Veykril commented Feb 2, 2021

There already is such a feature, the config is rust-analyzer.inlayHints.maxLength. The default value for this is unlimited(null). This config causes type hints to get truncated after reaching the number of characters by replacing any other nested hints with ...

@SomeoneToIgnore
Copy link
Contributor

We also have #3138 and #4151 that cover the same issue, I think we can close this one.

@arturoc
Copy link
Author

arturoc commented Feb 3, 2021

Thanks!

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

No branches or pull requests

3 participants