-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Shows a banner if a file has too many highlighted unicode characters. #137889
Conversation
hediet
commented
Nov 25, 2021
•
edited
edited
4df5d26
to
74bc6aa
Compare
74bc6aa
to
433b97d
Compare
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.
Very nice! 👏
@@ -458,6 +458,7 @@ export abstract class CommonEditorConfiguration extends Disposable implements IC | |||
|
|||
protected abstract readConfiguration(styling: BareFontInfo): FontInfo; | |||
|
|||
public abstract reserveHeight(height: number): void; |
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.
Now I realize that this method could be implemented here because it doesn't need any dom stuff (it can live in /common/
here). _computeInternalOptions
could then subtract the reserved height.
@@ -424,6 +516,78 @@ const DECORATION = ModelDecorationOptions.register({ | |||
} | |||
}); | |||
|
|||
export class DisableHighlightingOfAmbiguousCharactersAction extends EditorAction { | |||
public static ID = 'editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters'; | |||
public readonly shortLabel = nls.localize('unicodeHighlight.disableHighlightingOfAmbiguousCharacters.shortLabel', ''); |
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.
It looks like shortLabel
here is gettting removed by the tree shaking. The reason is that if you try to find all references or rename this property, you will notice that no references are found by TypeScript, or that the rename introduces a compilation error.
The solution is to be more explicit (instead of relying 100% on duck-typing) and create a new interface IDisableUnicodeHighlightAction
with the shortLabel
property and then explicitly implement it.
256eae8
to
8a305e1
Compare
…hlighting-banner Shows a banner if a file has too many highlighted unicode characters.