-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
feat: invisible character help string #150790
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
base: main
Are you sure you want to change the base?
feat: invisible character help string #150790
Conversation
|
rustbot has assigned @WaffleLapkin. Use |
This comment has been minimized.
This comment has been minimized.
| // way. | ||
| let (token, sugg) = | ||
| unicode_chars::check_for_substitution(self, start, c, repeats + 1); | ||
| const INVISIBLE_CHARACTERS: [char; 8] = ['\u{200B}', '\u{200C}', '\u{2060}', '\u{2061}', '\u{2062}', '\u{00AD}', '\u{034F}', '\u{061C}']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any place this list could be sourced from so we don't need to maintain it in this specific place? There are definitely more as well. Maybe one of the unicode- crates provides it, @Manishearth would know.
Also having a const in the middle of a block is rather unidiomatic, if kept it should be moved to the top of the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found a list of invisible characters here: https://www.editpad.org/tool/invisible-character. I only took ones that didn't actually take up a space.
I can move the const to the top of the file as well if that's more idiomatic.
|
this clippy lint only does this on string literals though from what I can tell |
11d0da1 to
a6212c5
Compare
|
Could you please squash the commits? |
|
^ and drop the emojis pls, we know what a feature is even without the ✨ :) |
Is there any specific guidelines for commit messages? I was made semi-aware of squashing commits but was not made aware of how commits are meant to be formatted. I used the conventional commits extension in VSC so I'm just trying to make sure I only have to do this once! |
|
Nothing too specific :) "conventional" prefixes like Gitmoji is just pretty superfluous and doesn't match anything in the log, so we ask to avoid emojis in summaries. |
a6212c5 to
2b597f5
Compare
|
@rustbot ready |
|
I assume you were taking a look at this / ready to approve based on the squash request, so r? @Kivooeo |
My bad, I thought I just needed to put the status label back to waiting for review! I did squash the commits, removed the emoji and changed the title like you mentioned though :) |
|
I asked for the commits to be squashed as there were quite a few small ones I'll take a final look at the implementation later today - it's 6 am here and it's been a long day, I apologise in advance for any potential delays and appreciate your patience |
I was playing around with zero width spaces in different programming languages and thought that this error message could be more helpful. Hopefully it's a good first contribution! :)