diff options
author | Alex Dima <alexdima@microsoft.com> | 2021-11-04 01:34:09 +0300 |
---|---|---|
committer | Alex Dima <alexdima@microsoft.com> | 2021-11-04 01:34:41 +0300 |
commit | a704a69394a3fbd241feaa6c0305067f25f866f5 (patch) | |
tree | 7128353d851be3088262a7005a88ae2367b23f1a | |
parent | 3247c31f6a4495c538618491f6b273fdfeaf8429 (diff) |
Enforce that source code uses a small subset of Unicode
33 files changed, 141 insertions, 55 deletions
diff --git a/build/filters.js b/build/filters.js index d5d96690780..872ed47f9ea 100644 --- a/build/filters.js +++ b/build/filters.js @@ -24,6 +24,36 @@ module.exports.all = [ '!**/node_modules/**', ]; +module.exports.unicodeFilter = [ + '**', + + '!**/ThirdPartyNotices.txt', + '!**/LICENSE.{txt,rtf}', + '!LICENSES.chromium.html', + '!**/LICENSE', + + '!**/*.{dll,exe,png,bmp,jpg,scpt,cur,ttf,woff,eot,template,ico,icns}', + '!**/test/**', + '!**/*.test.ts', + '!**/*.{d.ts,json,md}', + + '!build/win32/**', + '!extensions/markdown-language-features/notebook-out/*.js', + '!extensions/markdown-math/notebook-out/**', + '!extensions/php-language-features/src/features/phpGlobalFunctions.ts', + '!extensions/typescript-language-features/test-workspace/**', + '!extensions/vscode-api-tests/testWorkspace/**', + '!extensions/vscode-api-tests/testWorkspace2/**', + '!extensions/vscode-custom-editor-tests/test-workspace/**', + '!extensions/**/dist/**', + '!extensions/**/out/**', + '!extensions/**/snippets/**', + '!extensions/**/colorize-fixtures/**', + + '!src/vs/base/browser/dompurify/**', + '!src/vs/workbench/services/keybinding/browser/keyboardLayouts/**', +]; + module.exports.indentationFilter = [ '**', diff --git a/build/hygiene.js b/build/hygiene.js index 9d6756dbc86..611b64a54f8 100644 --- a/build/hygiene.js +++ b/build/hygiene.js @@ -10,7 +10,7 @@ const vfs = require('vinyl-fs'); const path = require('path'); const fs = require('fs'); const pall = require('p-all'); -const { all, copyrightFilter, indentationFilter, jsHygieneFilter, tsHygieneFilter } = require('./filters'); +const { all, copyrightFilter, unicodeFilter, indentationFilter, jsHygieneFilter, tsHygieneFilter } = require('./filters'); const copyrightHeaderLines = [ '/*---------------------------------------------------------------------------------------------', @@ -36,10 +36,35 @@ function hygiene(some, linting = true) { this.emit('data', file); }); - const indentation = es.through(function (file) { + const unicode = es.through(function (file) { const lines = file.contents.toString('utf8').split(/\r\n|\r|\n/); file.__lines = lines; + let skipNext = false; + lines.forEach((line, i) => { + if (/allow-any-unicode-next-line/.test(line)) { + skipNext = true; + return; + } + if (skipNext) { + skipNext = false; + return; + } + // Please do not add symbols that resemble ASCII letters! + const m = /([^\t\n\r\x20-\x7E⊃⊇✔︎✓🎯⚠️🛑🔴🚗🚙🚕🎉✨❗⇧⌥⌘×÷¦⋯…↑↓→→←↔⟷·•●◆▼⟪⟫┌└├⏎↩√φ]+)/g.exec(line); + if (m) { + console.error( + file.relative + `(${i + 1},${m.index + 1}): Unexpected unicode character: "${m[0]}". To suppress, use // allow-any-unicode-next-line` + ); + errorCount++; + } + }); + }); + + const indentation = es.through(function (file) { + const lines = file.__lines || file.contents.toString('utf8').split(/\r\n|\r|\n/); + file.__lines = lines; + lines.forEach((line, i) => { if (/^\s*$/.test(line)) { // empty or whitespace lines are OK @@ -121,12 +146,16 @@ function hygiene(some, linting = true) { } const productJsonFilter = filter('product.json', { restore: true }); + const unicodeFilterStream = filter(unicodeFilter, { restore: true }); const result = input .pipe(filter((f) => !f.stat.isDirectory())) .pipe(productJsonFilter) .pipe(process.env['BUILD_SOURCEVERSION'] ? es.through() : productJson) .pipe(productJsonFilter.restore) + .pipe(unicodeFilterStream) + .pipe(unicode) + .pipe(unicodeFilterStream.restore) .pipe(filter(indentationFilter)) .pipe(indentation) .pipe(filter(copyrightFilter)) diff --git a/extensions/emmet/src/locateFile.ts b/extensions/emmet/src/locateFile.ts index 84ab1db9cf8..decb8852cc1 100644 --- a/extensions/emmet/src/locateFile.ts +++ b/extensions/emmet/src/locateFile.ts @@ -16,7 +16,7 @@ const reAbsoluteWin32 = /^\\+/; const reAbsolute = path.sep === '/' ? reAbsolutePosix : reAbsoluteWin32; /** - * Locates given `filePath` on user’s file system and returns absolute path to it. + * Locates given `filePath` on user's file system and returns absolute path to it. * This method expects either URL, or relative/absolute path to resource * @param basePath Base path to use if filePath is not absoulte * @param filePath File to locate. @@ -43,7 +43,7 @@ function resolveRelative(basePath: string, filePath: string): Promise<string> { /** * Resolves absolute file path agaist given editor: tries to find file in every - * parent of editor’s file + * parent of editor's file */ function resolveAbsolute(basePath: string, filePath: string): Promise<string> { return new Promise((resolve, reject) => { @@ -66,7 +66,7 @@ function resolveAbsolute(basePath: string, filePath: string): Promise<string> { } /** - * Check if given file exists and it’s a file, not directory + * Check if given file exists and it's a file, not directory */ function tryFile(file: string): Promise<string> { return new Promise((resolve, reject) => { diff --git a/extensions/git/src/timelineProvider.ts b/extensions/git/src/timelineProvider.ts index 5a9a1390bf1..e43a2a0b84f 100644 --- a/extensions/git/src/timelineProvider.ts +++ b/extensions/git/src/timelineProvider.ts @@ -166,6 +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}`; const cmd = this.commands.resolveTimelineOpenDiffCommand(item, uri); @@ -191,6 +192,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)); const cmd = this.commands.resolveTimelineOpenDiffCommand(item, uri); @@ -213,6 +215,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)); const cmd = this.commands.resolveTimelineOpenDiffCommand(item, uri); diff --git a/extensions/markdown-language-features/notebook/index.ts b/extensions/markdown-language-features/notebook/index.ts index f76b227fd14..5fdaadef71d 100644 --- a/extensions/markdown-language-features/notebook/index.ts +++ b/extensions/markdown-language-features/notebook/index.ts @@ -233,6 +233,7 @@ function slugFromHeading(heading: string): string { heading.trim() .toLowerCase() .replace(/\s+/g, '-') // Replace whitespace with - + // allow-any-unicode-next-line .replace(/[\]\[\!\'\#\$\%\&\(\)\*\+\,\.\/\:\;\<\=\>\?\@\\\^\_\{\|\}\~\`。,、;:?!…—·ˉ¨‘’“”々~‖∶"'`|〃〔〕〈〉《》「」『』.〖〗【】()[]{}]/g, '') // Remove known punctuators .replace(/^\-+/, '') // Remove leading - .replace(/\-+$/, '') // Remove trailing - diff --git a/extensions/markdown-language-features/src/slugify.ts b/extensions/markdown-language-features/src/slugify.ts index a91c5126a22..c6a42d2ac15 100644 --- a/extensions/markdown-language-features/src/slugify.ts +++ b/extensions/markdown-language-features/src/slugify.ts @@ -23,6 +23,7 @@ export const githubSlugifier: Slugifier = new class implements Slugifier { heading.trim() .toLowerCase() .replace(/\s+/g, '-') // Replace whitespace with - + // allow-any-unicode-next-line .replace(/[\]\[\!\'\#\$\%\&\(\)\*\+\,\.\/\:\;\<\=\>\?\@\\\^\_\{\|\}\~\`。,、;:?!…—·ˉ¨‘’“”々~‖∶"'`|〃〔〕〈〉《》「」『』.〖〗【】()[]{}]/g, '') // Remove known punctuators .replace(/^\-+/, '') // Remove leading - .replace(/\-+$/, '') // Remove trailing - diff --git a/extensions/typescript-language-features/src/utils/previewer.ts b/extensions/typescript-language-features/src/utils/previewer.ts index 7ce0e7713da..a443efba037 100644 --- a/extensions/typescript-language-features/src/utils/previewer.ts +++ b/extensions/typescript-language-features/src/utils/previewer.ts @@ -90,6 +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)}`); } } @@ -100,6 +101,7 @@ function getTagDocumentation( if (!text) { return label; } + // allow-any-unicode-next-line return label + (text.match(/\r\n|\n/g) ? ' \n' + text : ` — ${text}`); } diff --git a/scripts/code.sh b/scripts/code.sh index 5acc461f51c..9caa49b1bf7 100755 --- a/scripts/code.sh +++ b/scripts/code.sh @@ -48,7 +48,7 @@ function code() { function code-wsl() { - HOST_IP=$(echo "" | powershell.exe –noprofile -Command "& {(Get-NetIPAddress | Where-Object {\$_.InterfaceAlias -like '*WSL*' -and \$_.AddressFamily -eq 'IPv4'}).IPAddress | Write-Host -NoNewline}") + HOST_IP=$(echo "" | powershell.exe -noprofile -Command "& {(Get-NetIPAddress | Where-Object {\$_.InterfaceAlias -like '*WSL*' -and \$_.AddressFamily -eq 'IPv4'}).IPAddress | Write-Host -NoNewline}") export DISPLAY="$HOST_IP:0" # in a wsl shell diff --git a/src/vs/base/common/keybindingLabels.ts b/src/vs/base/common/keybindingLabels.ts index c490b80eb84..c4857834c88 100644 --- a/src/vs/base/common/keybindingLabels.ts +++ b/src/vs/base/common/keybindingLabels.ts @@ -54,6 +54,7 @@ export class ModifierLabelProvider { */ export const UILabelProvider = new ModifierLabelProvider( { + // allow-any-unicode-next-line ctrlKey: '⌃', shiftKey: '⇧', altKey: '⌥', diff --git a/src/vs/base/common/strings.ts b/src/vs/base/common/strings.ts index 8a6bc0c28a2..e6a325056cb 100644 --- a/src/vs/base/common/strings.ts +++ b/src/vs/base/common/strings.ts @@ -596,43 +596,42 @@ export function containsFullWidthCharacter(str: string): boolean { export function isFullWidthCharacter(charCode: number): boolean { // Do a cheap trick to better support wrapping of wide characters, treat them as 2 columns // http://jrgraphix.net/research/unicode_blocks.php - // 2E80 — 2EFF CJK Radicals Supplement - // 2F00 — 2FDF Kangxi Radicals - // 2FF0 — 2FFF Ideographic Description Characters - // 3000 — 303F CJK Symbols and Punctuation - // 3040 — 309F Hiragana - // 30A0 — 30FF Katakana - // 3100 — 312F Bopomofo - // 3130 — 318F Hangul Compatibility Jamo - // 3190 — 319F Kanbun - // 31A0 — 31BF Bopomofo Extended - // 31F0 — 31FF Katakana Phonetic Extensions - // 3200 — 32FF Enclosed CJK Letters and Months - // 3300 — 33FF CJK Compatibility - // 3400 — 4DBF CJK Unified Ideographs Extension A - // 4DC0 — 4DFF Yijing Hexagram Symbols - // 4E00 — 9FFF CJK Unified Ideographs - // A000 — A48F Yi Syllables - // A490 — A4CF Yi Radicals - // AC00 — D7AF Hangul Syllables - // [IGNORE] D800 — DB7F High Surrogates - // [IGNORE] DB80 — DBFF High Private Use Surrogates - // [IGNORE] DC00 — DFFF Low Surrogates - // [IGNORE] E000 — F8FF Private Use Area - // F900 — FAFF CJK Compatibility Ideographs - // [IGNORE] FB00 — FB4F Alphabetic Presentation Forms - // [IGNORE] FB50 — FDFF Arabic Presentation Forms-A - // [IGNORE] FE00 — FE0F Variation Selectors - // [IGNORE] FE20 — FE2F Combining Half Marks - // [IGNORE] FE30 — FE4F CJK Compatibility Forms - // [IGNORE] FE50 — FE6F Small Form Variants - // [IGNORE] FE70 — FEFF Arabic Presentation Forms-B - // FF00 — FFEF Halfwidth and Fullwidth Forms + // 2E80 - 2EFF CJK Radicals Supplement + // 2F00 - 2FDF Kangxi Radicals + // 2FF0 - 2FFF Ideographic Description Characters + // 3000 - 303F CJK Symbols and Punctuation + // 3040 - 309F Hiragana + // 30A0 - 30FF Katakana + // 3100 - 312F Bopomofo + // 3130 - 318F Hangul Compatibility Jamo + // 3190 - 319F Kanbun + // 31A0 - 31BF Bopomofo Extended + // 31F0 - 31FF Katakana Phonetic Extensions + // 3200 - 32FF Enclosed CJK Letters and Months + // 3300 - 33FF CJK Compatibility + // 3400 - 4DBF CJK Unified Ideographs Extension A + // 4DC0 - 4DFF Yijing Hexagram Symbols + // 4E00 - 9FFF CJK Unified Ideographs + // A000 - A48F Yi Syllables + // A490 - A4CF Yi Radicals + // AC00 - D7AF Hangul Syllables + // [IGNORE] D800 - DB7F High Surrogates + // [IGNORE] DB80 - DBFF High Private Use Surrogates + // [IGNORE] DC00 - DFFF Low Surrogates + // [IGNORE] E000 - F8FF Private Use Area + // F900 - FAFF CJK Compatibility Ideographs + // [IGNORE] FB00 - FB4F Alphabetic Presentation Forms + // [IGNORE] FB50 - FDFF Arabic Presentation Forms-A + // [IGNORE] FE00 - FE0F Variation Selectors + // [IGNORE] FE20 - FE2F Combining Half Marks + // [IGNORE] FE30 - FE4F CJK Compatibility Forms + // [IGNORE] FE50 - FE6F Small Form Variants + // [IGNORE] FE70 - FEFF Arabic Presentation Forms-B + // FF00 - FFEF Halfwidth and Fullwidth Forms // [https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms] // of which FF01 - FF5E fullwidth ASCII of 21 to 7E // [IGNORE] and FF65 - FFDC halfwidth of Katakana and Hangul - // [IGNORE] FFF0 — FFFF Specials - charCode = +charCode; // @perf + // [IGNORE] FFF0 - FFFF Specials return ( (charCode >= 0x2E80 && charCode <= 0xD7AF) || (charCode >= 0xF900 && charCode <= 0xFAFF) diff --git a/src/vs/editor/browser/controller/textAreaState.ts b/src/vs/editor/browser/controller/textAreaState.ts index b9848def983..4c240bfd378 100644 --- a/src/vs/editor/browser/controller/textAreaState.ts +++ b/src/vs/editor/browser/controller/textAreaState.ts @@ -172,6 +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 // Oftentimes, emojis use Variation Selector-16 (U+FE0F), so that is a good hint diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts index c28814f567e..fae61d04453 100644 --- a/src/vs/editor/common/config/editorOptions.ts +++ b/src/vs/editor/common/config/editorOptions.ts @@ -298,12 +298,10 @@ export interface IEditorOptions { wrappingStrategy?: 'simple' | 'advanced'; /** * Configure word wrapping characters. A break will be introduced before these characters. - * Defaults to '([{‘“〈《「『【〔([{「£¥$£¥++'. */ wordWrapBreakBeforeCharacters?: string; /** * Configure word wrapping characters. A break will be introduced after these characters. - * Defaults to ' \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」'. */ wordWrapBreakAfterCharacters?: string; /** @@ -4866,10 +4864,12 @@ export const EditorOptions = { )), wordWrapBreakAfterCharacters: register(new EditorStringOption( EditorOption.wordWrapBreakAfterCharacters, 'wordWrapBreakAfterCharacters', + // allow-any-unicode-next-line ' \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」', )), wordWrapBreakBeforeCharacters: register(new EditorStringOption( EditorOption.wordWrapBreakBeforeCharacters, 'wordWrapBreakBeforeCharacters', + // allow-any-unicode-next-line '([{‘“〈《「『【〔([{「£¥$£¥++' )), wordWrapColumn: register(new EditorIntOption( diff --git a/src/vs/editor/common/modes/linkComputer.ts b/src/vs/editor/common/modes/linkComputer.ts index c6249cb323a..a57dfa29fa0 100644 --- a/src/vs/editor/common/modes/linkComputer.ts +++ b/src/vs/editor/common/modes/linkComputer.ts @@ -154,6 +154,7 @@ function getClassifier(): CharacterClassifier<CharacterClass> { if (_classifier === null) { _classifier = new CharacterClassifier<CharacterClass>(CharacterClass.None); + // allow-any-unicode-next-line const FORCE_TERMINATION_CHARACTERS = ' \t<>\'\"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…'; for (let i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) { _classifier.set(FORCE_TERMINATION_CHARACTERS.charCodeAt(i), CharacterClass.ForceTermination); diff --git a/src/vs/editor/common/viewLayout/viewLineRenderer.ts b/src/vs/editor/common/viewLayout/viewLineRenderer.ts index 5c1e286bb52..d8615a93da0 100644 --- a/src/vs/editor/common/viewLayout/viewLineRenderer.ts +++ b/src/vs/editor/common/viewLayout/viewLineRenderer.ts @@ -645,8 +645,8 @@ function isControlCharacter(charCode: number): boolean { // PDF U+202C POP DIRECTIONAL FORMATTING // LRO U+202D LEFT-TO-RIGHT OVERRIDE // RLO U+202E RIGHT-TO-LEFT OVERRIDE - // LRI U+2066 LEFT‑TO‑RIGHT ISOLATE - // RLI U+2067 RIGHT‑TO‑LEFT ISOLATE + // LRI U+2066 LEFT-TO-RIGHT ISOLATE + // RLI U+2067 RIGHT-TO-LEFT ISOLATE // FSI U+2068 FIRST STRONG ISOLATE // PDI U+2069 POP DIRECTIONAL ISOLATE // LRM U+200E LEFT-TO-RIGHT MARK diff --git a/src/vs/editor/contrib/suggest/suggestModel.ts b/src/vs/editor/contrib/suggest/suggestModel.ts index c37c1e46629..9cda841e03f 100644 --- a/src/vs/editor/contrib/suggest/suggestModel.ts +++ b/src/vs/editor/contrib/suggest/suggestModel.ts @@ -198,9 +198,9 @@ export class SuggestModel implements IDisposable { this._onCompositionEnd(); })); this._toDispose.add(this._editor.onDidChangeModelContent(() => { - // only filter completions when the editor isn't - // composing a character, e.g. ¨ + u makes ü but just - // ¨ cannot be used for filtering + // only filter completions when the editor isn't composing a character + // allow-any-unicode-next-line + // e.g. ¨ + u makes ü but just ¨ cannot be used for filtering if (!editorIsComposing) { this._refilterCompletionItems(); } diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index ed8d3e6201e..26f00ba6fa3 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -2957,12 +2957,10 @@ declare namespace monaco.editor { wrappingStrategy?: 'simple' | 'advanced'; /** * Configure word wrapping characters. A break will be introduced before these characters. - * Defaults to '([{‘“〈《「『【〔([{「£¥$£¥++'. */ wordWrapBreakBeforeCharacters?: string; /** * Configure word wrapping characters. A break will be introduced after these characters. - * Defaults to ' \t})]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」'. */ wordWrapBreakAfterCharacters?: string; /** diff --git a/src/vs/platform/assignment/common/assignment.ts b/src/vs/platform/assignment/common/assignment.ts index 513296737f0..7ca130fe9f3 100644 --- a/src/vs/platform/assignment/common/assignment.ts +++ b/src/vs/platform/assignment/common/assignment.ts @@ -27,7 +27,7 @@ ExP backend for the VSCode cluster. https://experimentation.visualstudio.com/Analysis%20and%20Experimentation/_git/AnE.ExP.TAS.TachyonHost.Configuration?path=%2FConfigurations%2Fvscode%2Fvscode.json&version=GBmaster "X-MSEdge-Market": "detection.market", "X-FD-Corpnet": "detection.corpnet", -"X-VSCode–AppVersion": "appversion", +"X-VSCode-AppVersion": "appversion", "X-VSCode-Build": "build", "X-MSEdge-ClientId": "clientid", "X-VSCode-ExtensionName": "extensionname", diff --git a/src/vs/workbench/api/common/cache.ts b/src/vs/workbench/api/common/cache.ts index 981ad472fc8..bf640a5893d 100644 --- a/src/vs/workbench/api/common/cache.ts +++ b/src/vs/workbench/api/common/cache.ts @@ -34,6 +34,6 @@ export class Cache<T> { if (!Cache.enableDebugLogging) { return; } - console.log(`${this.id} cache size — ${this._data.size}`); + console.log(`${this.id} cache size - ${this._data.size}`); } } diff --git a/src/vs/workbench/browser/workbench.contribution.ts b/src/vs/workbench/browser/workbench.contribution.ts index b8a8c87d94e..202807796b0 100644 --- a/src/vs/workbench/browser/workbench.contribution.ts +++ b/src/vs/workbench/browser/workbench.contribution.ts @@ -409,6 +409,7 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con }, 'window.titleSeparator': { 'type': 'string', + // allow-any-unicode-next-line 'default': isMacintosh ? ' — ' : ' - ', 'markdownDescription': localize("window.titleSeparator", "Separator used by `window.title`.") }, diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index d363466b598..3ec2663a9ff 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -114,7 +114,7 @@ export interface IEditorDescriptor<T extends IEditorPane> { export interface IEditorPane extends IComposite { /** - * An event to notify when the `IEditorControl´ in this + * An event to notify when the `IEditorControl` in this * editor pane changes. * * This can be used for editor panes that are a compound diff --git a/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts b/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts index 586fe109345..1114088c35c 100644 --- a/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts +++ b/src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts @@ -320,7 +320,7 @@ export class CommentController implements IEditorContribution { this._commentWidgets.forEach(widget => widget.dispose()); - this.editor = null!; // Strict null override — nulling out in dispose + this.editor = null!; // Strict null override - nulling out in dispose } public onModelChanged(e: IModelChangedEvent): void { diff --git a/src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts b/src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts index 30791034608..310e7549105 100644 --- a/src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts +++ b/src/vs/workbench/contrib/debug/browser/debugActionViewItems.ts @@ -27,6 +27,7 @@ const $ = dom.$; export class StartDebugActionViewItem extends BaseActionViewItem { + // allow-any-unicode-next-line private static readonly SEPARATOR = '─────────'; private container!: HTMLElement; diff --git a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts index 72785b4124d..808237a4199 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionEditor.ts @@ -1548,7 +1548,9 @@ 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 ? '✔︎' : '—')) )) ) diff --git a/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css b/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css index 6fb7722a672..8021133a7a1 100644 --- a/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css +++ b/src/vs/workbench/contrib/languageStatus/browser/media/languageStatus.css @@ -44,6 +44,7 @@ } .monaco-workbench .hover-language-status > .element > .left > .detail:not(:empty)::before { + /* allow-any-unicode-next-line */ content: '–'; padding: 0 4px; opacity: 0.6; diff --git a/src/vs/workbench/contrib/output/browser/outputView.ts b/src/vs/workbench/contrib/output/browser/outputView.ts index 31523448ab2..9db7a355a31 100644 --- a/src/vs/workbench/contrib/output/browser/outputView.ts +++ b/src/vs/workbench/contrib/output/browser/outputView.ts @@ -271,6 +271,7 @@ export class OutputEditor extends AbstractTextResourceEditor { class SwitchOutputActionViewItem extends SelectActionViewItem { + // allow-any-unicode-next-line private static readonly SEPARATOR = '─────────'; private outputChannels: IOutputChannelDescriptor[] = []; diff --git a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts index ef49e328ebb..44b34029af1 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts @@ -1181,6 +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, ' ')); if (query && this.searchResultModel) { diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts b/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts index f699cb4d5dc..3fae861e143 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts @@ -520,6 +520,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])([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 diff --git a/src/vs/workbench/contrib/terminal/browser/terminalActions.ts b/src/vs/workbench/contrib/terminal/browser/terminalActions.ts index 1bacb7cd81c..7397f11c1be 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalActions.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalActions.ts @@ -47,6 +47,7 @@ import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteA import { SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService'; import { isAbsolute } from 'vs/base/common/path'; +// allow-any-unicode-next-line export const switchTerminalActionViewItemSeparator = '─────────'; export const switchTerminalShowTabsTitle = localize('showTerminalTabs', "Show Tabs"); @@ -980,6 +981,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, description: term.pid ? String(term.pid) : '', term diff --git a/src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts b/src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts index fe945b86aad..84d3e578a02 100644 --- a/src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts +++ b/src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts @@ -418,6 +418,7 @@ const terminalConfiguration: IConfigurationNode = { [TerminalSettingId.WordSeparators]: { description: localize('terminal.integrated.wordSeparators', "A string containing all characters to be considered word separators by the double click to select word feature."), type: 'string', + // allow-any-unicode-next-line default: ' ()[]{}\',"`─‘’' }, [TerminalSettingId.EnableFileLinks]: { diff --git a/src/vs/workbench/contrib/testing/browser/explorerProjections/display.ts b/src/vs/workbench/contrib/testing/browser/explorerProjections/display.ts index e2dccbe6462..c26642329d4 100644 --- a/src/vs/workbench/contrib/testing/browser/explorerProjections/display.ts +++ b/src/vs/workbench/contrib/testing/browser/explorerProjections/display.ts @@ -3,4 +3,5 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +// allow-any-unicode-next-line export const flatTestItemDelimiter = ' › '; diff --git a/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts b/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts index d08004d0337..988566b13e7 100644 --- a/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts +++ b/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts @@ -1021,12 +1021,19 @@ 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 , => , } return charCode; diff --git a/src/vs/workbench/services/search/common/getFileResults.ts b/src/vs/workbench/services/search/common/getFileResults.ts index 2a5878db2c2..91fe2623dfd 100644 --- a/src/vs/workbench/services/search/common/getFileResults.ts +++ b/src/vs/workbench/services/search/common/getFileResults.ts @@ -25,6 +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('�') && bytes.includes(0)) { return []; } diff --git a/src/vs/workbench/services/search/common/searchExtTypes.ts b/src/vs/workbench/services/search/common/searchExtTypes.ts index fa4684ffff6..3c01bb86948 100644 --- a/src/vs/workbench/services/search/common/searchExtTypes.ts +++ b/src/vs/workbench/services/search/common/searchExtTypes.ts @@ -71,13 +71,13 @@ export interface RelativePattern { /** * A file glob pattern to match file paths against. This can either be a glob pattern string - * (like `**/*.{ts,js}` or `*.{ts,js}`) or a [relative pattern](#RelativePattern). + * (like `** /*.{ts,js}` without space before / or `*.{ts,js}`) or a [relative pattern](#RelativePattern). * * Glob patterns can have the following syntax: * * `*` to match one or more characters in a path segment * * `?` to match on one character in a path segment * * `**` to match any number of path segments, including none - * * `{}` to group conditions (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files) + * * `{}` to group conditions (e.g. `** /*.{ts,js}` without space before / matches all TypeScript and JavaScript files) * * `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …) * * `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`) * |