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

Configure unicode highlight limit #139726

Open
Zezombye opened this issue Dec 24, 2021 · 6 comments
Open

Configure unicode highlight limit #139726

Zezombye opened this issue Dec 24, 2021 · 6 comments
Assignees
Labels
feature-request Request for new features or functionality unicode-highlight
Milestone

Comments

@Zezombye
Copy link

Unicode highlighting behaves normally when there are few special characters:
image

However, when there are too many characters, vscode just gives up and does not highlight any:

Would it be possible to configure the limit before it gives up (does it take up that many resources to highlight them? in my test file there are 5337, syntax highlighting doesn't give up), and also to add an option to not have that popup so that I don't have to click the "x" each time?

Thanks :)

@gjsjohnmurray
Copy link
Contributor

/assign @hediet

@hediet
Copy link
Member

hediet commented Jan 3, 2022

does it take up that many resources to highlight them?

The resource constraint is only one reason why this message is shown.

The other reason is that if a document uses that many invisible characters, this is probably done intentionally and it would be counter-productive to highlight every single occurence (which seems to be the case in your screenshot).

What is your use-case?

@hediet hediet added unicode-highlight feature-request Request for new features or functionality labels Jan 3, 2022
@hediet hediet added this to the Backlog milestone Jan 3, 2022
@Zezombye
Copy link
Author

Zezombye commented Jan 3, 2022

Finding out, in a French translation file for a game, which strings are used where (and exact matching is important). In French, "official" typography requires the use of non-breaking spaces (the bane of my existence) in some places, and the translators sometimes put them, sometimes don't.

So I wanted to find the id of the string "Equipe 1" where there is a nbsp (there are multiple matches for this string, some having a normal space, some having a nbsp), so I ctrl-f "Equipe" and look at which ones have a highlighted space, but since none of them was highlighted I thought there wasn't any nbsp, and that the file wasn't correct. In the end I had to copy paste a nbsp from internet to successfully search it, but I was confused, especially since the banner has a button to disable unicode highlighting when no highlighting is done :p

I think even if it is done intentionally, it will always be beneficial to highlight every occurrence (it's always nice to know when spaces aren't really spaces). Else, the banner should specify that no highlighting is being done at all.

@hediet
Copy link
Member

hediet commented Jan 3, 2022

Maybe a checkbox in the banner would work nicely.
The checkbox would toggle a setting like "editor.unicodeHighlighting.highlightWhenBannerIsShown", which is disabled by default.

@Zezombye
Copy link
Author

Zezombye commented Jan 3, 2022

That would be nice yes, and also disable the banner if checked.

Also I absolutely love this feature, I no longer have to highlight some random space to find out wacky spaces :D

@hediet hediet modified the milestones: Backlog, January 2022 Jan 3, 2022
@hediet hediet modified the milestones: January 2022, February 2022 Jan 27, 2022
@miguelsolorio
Copy link
Contributor

miguelsolorio commented Feb 22, 2022

@hediet we should bring this banner to the ux sync as we've only reserved the banner for vscode.dev and workspace trust and already have other patterns for altering the user of errors/warnings in the editor

@hediet hediet modified the milestones: February 2022, March 2022 Feb 23, 2022
@hediet hediet modified the milestones: March 2022, April 2022 Mar 24, 2022
@hediet hediet modified the milestones: April 2022, May 2022 Apr 29, 2022
@hediet hediet modified the milestones: May 2022, June 2022 Jun 2, 2022
@hediet hediet modified the milestones: June 2022, July 2022 Jul 1, 2022
@hediet hediet modified the milestones: July 2022, August 2022 Jul 29, 2022
@hediet hediet modified the milestones: August 2022, On Deck Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality unicode-highlight
Projects
None yet
Development

No branches or pull requests

4 participants