Reduce usage of allow-any-unicode-next-line

This commit is contained in:
Alex Dima 2021-11-20 21:01:29 +01:00
parent 981ab5e8d3
commit cae6e662ce
No known key found for this signature in database
GPG key ID: 39563C1504FDD0C9
14 changed files with 27 additions and 49 deletions

View file

@ -166,8 +166,7 @@ export class GitTimelineProvider implements TimelineProvider {
if (showAuthor) {
item.description = c.authorName;
}
// allow-any-unicode-next-line
item.detail = `${c.authorName} (${c.authorEmail}) — ${c.hash.substr(0, 8)}\n${dateFormatter.format(date)}\n\n${message}`;
item.detail = `${c.authorName} (${c.authorEmail}) \u2014 ${c.hash.substr(0, 8)}\n${dateFormatter.format(date)}\n\n${message}`;
const cmd = this.commands.resolveTimelineOpenDiffCommand(item, uri);
if (cmd) {
@ -192,8 +191,7 @@ export class GitTimelineProvider implements TimelineProvider {
// TODO@eamodio: Replace with a better icon -- reflecting its status maybe?
item.iconPath = new ThemeIcon('git-commit');
item.description = '';
// allow-any-unicode-next-line
item.detail = localize('git.timeline.detail', '{0} — {1}\n{2}\n\n{3}', you, localize('git.index', 'Index'), dateFormatter.format(date), Resource.getStatusText(index.type));
item.detail = localize('git.timeline.detail', '{0} \u2014 {1}\n{2}\n\n{3}', you, localize('git.index', 'Index'), dateFormatter.format(date), Resource.getStatusText(index.type));
const cmd = this.commands.resolveTimelineOpenDiffCommand(item, uri);
if (cmd) {
@ -215,8 +213,7 @@ export class GitTimelineProvider implements TimelineProvider {
// TODO@eamodio: Replace with a better icon -- reflecting its status maybe?
item.iconPath = new ThemeIcon('git-commit');
item.description = '';
// allow-any-unicode-next-line
item.detail = localize('git.timeline.detail', '{0} — {1}\n{2}\n\n{3}', you, localize('git.workingTree', 'Working Tree'), dateFormatter.format(date), Resource.getStatusText(working.type));
item.detail = localize('git.timeline.detail', '{0} \u2014 {1}\n{2}\n\n{3}', you, localize('git.workingTree', 'Working Tree'), dateFormatter.format(date), Resource.getStatusText(working.type));
const cmd = this.commands.resolveTimelineOpenDiffCommand(item, uri);
if (cmd) {

View file

@ -90,8 +90,7 @@ function getTagDocumentation(
if (!doc) {
return label;
}
// allow-any-unicode-next-line
return label + (doc.match(/\r\n|\n/g) ? ' \n' + processInlineTags(doc) : `${processInlineTags(doc)}`);
return label + (doc.match(/\r\n|\n/g) ? ' \n' + processInlineTags(doc) : ` \u2014 ${processInlineTags(doc)}`);
}
}
@ -101,8 +100,7 @@ function getTagDocumentation(
if (!text) {
return label;
}
// allow-any-unicode-next-line
return label + (text.match(/\r\n|\n/g) ? ' \n' + text : `${text}`);
return label + (text.match(/\r\n|\n/g) ? ' \n' + text : ` \u2014 ${text}`);
}
export function plainWithLinks(

View file

@ -54,8 +54,7 @@ export class ModifierLabelProvider {
*/
export const UILabelProvider = new ModifierLabelProvider(
{
// allow-any-unicode-next-line
ctrlKey: '⌃',
ctrlKey: '\u2303',
shiftKey: '⇧',
altKey: '⌥',
metaKey: '⌘',

View file

@ -172,8 +172,7 @@ export class TextAreaState {
if (potentialEmojiInput !== null && potentialEmojiInput.length > 0) {
// now we check that this is indeed an emoji
// emojis can grow quite long, so a length check is of no help
// allow-any-unicode-next-line
// e.g. 1F3F4 E0067 E0062 E0065 E006E E0067 E007F ; fully-qualified # 🏴󠁧󠁢󠁥󠁮󠁧󠁿 England
// e.g. 1F3F4 E0067 E0062 E0065 E006E E0067 E007F -- flag of England
// Oftentimes, emojis use Variation Selector-16 (U+FE0F), so that is a good hint
// http://emojipedia.org/variation-selector-16/

View file

@ -421,8 +421,7 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
},
'window.titleSeparator': {
'type': 'string',
// allow-any-unicode-next-line
'default': isMacintosh ? ' — ' : ' - ',
'default': isMacintosh ? ' \u2014 ' : ' - ',
'markdownDescription': localize("window.titleSeparator", "Separator used by `window.title`.")
},
'window.menuBarVisibility': {

View file

@ -27,8 +27,7 @@ const $ = dom.$;
export class StartDebugActionViewItem extends BaseActionViewItem {
// allow-any-unicode-next-line
private static readonly SEPARATOR = '─────────';
private static readonly SEPARATOR = '\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500';
private container!: HTMLElement;
private start!: HTMLElement;

View file

@ -1550,10 +1550,8 @@ export class ExtensionEditor extends EditorPane {
$('td', undefined, l.id),
$('td', undefined, l.name),
$('td', undefined, ...join(l.extensions.map(ext => $('code', undefined, ext)), ' ')),
// allow-any-unicode-next-line
$('td', undefined, document.createTextNode(l.hasGrammar ? '✔︎' : '—')),
// allow-any-unicode-next-line
$('td', undefined, document.createTextNode(l.hasSnippets ? '✔︎' : '—'))
$('td', undefined, document.createTextNode(l.hasGrammar ? '✔︎' : '\u2014')),
$('td', undefined, document.createTextNode(l.hasSnippets ? '✔︎' : '\u2014'))
))
)
);

View file

@ -271,8 +271,7 @@ export class OutputEditor extends AbstractTextResourceEditor {
class SwitchOutputActionViewItem extends SelectActionViewItem {
// allow-any-unicode-next-line
private static readonly SEPARATOR = '─────────';
private static readonly SEPARATOR = '\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500';
private outputChannels: IOutputChannelDescriptor[] = [];
private logChannels: IOutputChannelDescriptor[] = [];

View file

@ -1181,8 +1181,7 @@ export class SettingsEditor2 extends EditorPane {
const query = this.searchWidget.getValue().trim();
this.delayedFilterLogging.cancel();
// allow-any-unicode-next-line
await this.triggerSearch(query.replace(//g, ' '));
await this.triggerSearch(query.replace(/\u203A/g, ' '));
if (query && this.searchResultModel) {
this.delayedFilterLogging.trigger(() => this.reportFilteringUsed(query, this.searchResultModel!.getUniqueResults()));

View file

@ -521,8 +521,7 @@ export function settingKeyToDisplayFormat(key: string, groupId = ''): { category
function wordifyKey(key: string): string {
key = key
// allow-any-unicode-next-line
.replace(/\.([a-z0-9])/g, (_, p1) => ` ${p1.toUpperCase()}`) // Replace dot with spaced '>'
.replace(/\.([a-z0-9])/g, (_, p1) => ` \u203A ${p1.toUpperCase()}`) // Replace dot with spaced '>'
.replace(/([a-z0-9])([A-Z])/g, '$1 $2') // Camel case to spacing, fooBar => foo Bar
.replace(/^[a-z]/g, match => match.toUpperCase()) // Upper casing all first letters, foo => Foo
.replace(/\b\w+\b/g, match => { // Upper casing known acronyms

View file

@ -50,8 +50,7 @@ import { ITerminalQuickPickItem } from 'vs/workbench/contrib/terminal/browser/te
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { getIconId, getColorClass, getUriClasses } from 'vs/workbench/contrib/terminal/browser/terminalIcon';
// allow-any-unicode-next-line
export const switchTerminalActionViewItemSeparator = '─────────';
export const switchTerminalActionViewItemSeparator = '\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500';
export const switchTerminalShowTabsTitle = localize('showTerminalTabs', "Show Tabs");
async function getCwdForSplit(configHelper: ITerminalConfigHelper, instance: ITerminalInstance, folders?: IWorkspaceFolder[], commandService?: ICommandService): Promise<string | URI | undefined> {
@ -988,8 +987,7 @@ export function registerTerminalActions() {
const cwdLabel = labelService.getUriLabel(URI.file(term.cwd));
return {
label: term.title,
// allow-any-unicode-next-line
detail: term.workspaceName ? `${term.workspaceName}${cwdLabel}` : cwdLabel,
detail: term.workspaceName ? `${term.workspaceName} \u2E31 ${cwdLabel}` : cwdLabel,
description: term.pid ? String(term.pid) : '',
term
};

View file

@ -3,5 +3,4 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// allow-any-unicode-next-line
export const flatTestItemDelimiter = ' ';
export const flatTestItemDelimiter = ' \u203A ';

View file

@ -1022,19 +1022,15 @@ export class MacLinuxKeyboardMapper implements IKeyboardMapper {
private static _redirectCharCode(charCode: number): number {
switch (charCode) {
// allow-any-unicode-next-line
case CharCode.U_IDEOGRAPHIC_FULL_STOP: return CharCode.Period; // CJK 。 => .
// allow-any-unicode-next-line
case CharCode.U_LEFT_CORNER_BRACKET: return CharCode.OpenSquareBracket; // CJK 「 => [
// allow-any-unicode-next-line
case CharCode.U_RIGHT_CORNER_BRACKET: return CharCode.CloseSquareBracket; // CJK 」 => ]
// allow-any-unicode-next-line
case CharCode.U_LEFT_BLACK_LENTICULAR_BRACKET: return CharCode.OpenSquareBracket; // CJK 【 => [
// allow-any-unicode-next-line
case CharCode.U_RIGHT_BLACK_LENTICULAR_BRACKET: return CharCode.CloseSquareBracket; // CJK 】 => ]
// allow-any-unicode-next-line
case CharCode.U_FULLWIDTH_SEMICOLON: return CharCode.Semicolon; // CJK => ;
// allow-any-unicode-next-line
case CharCode.U_FULLWIDTH_COMMA: return CharCode.Comma; // CJK => ,
// CJK: 。 「 」 【 】
// map: . [ ] [ ] ; ,
case CharCode.U_IDEOGRAPHIC_FULL_STOP: return CharCode.Period;
case CharCode.U_LEFT_CORNER_BRACKET: return CharCode.OpenSquareBracket;
case CharCode.U_RIGHT_CORNER_BRACKET: return CharCode.CloseSquareBracket;
case CharCode.U_LEFT_BLACK_LENTICULAR_BRACKET: return CharCode.OpenSquareBracket;
case CharCode.U_RIGHT_BLACK_LENTICULAR_BRACKET: return CharCode.CloseSquareBracket;
case CharCode.U_FULLWIDTH_SEMICOLON: return CharCode.Semicolon;
case CharCode.U_FULLWIDTH_COMMA: return CharCode.Comma;
}
return charCode;
}

View file

@ -25,8 +25,7 @@ export const getFileResults = (
text = new TextDecoder('utf-16be').decode(bytes);
} else {
text = new TextDecoder('utf8').decode(bytes);
// allow-any-unicode-next-line
if (text.slice(0, 1000).includes('<27>') && bytes.includes(0)) {
if (text.slice(0, 1000).includes('\uFFFD') && bytes.includes(0)) {
return [];
}
}