Code change:
CannotEndIn = 2 } <del> var getCharacterClasses = (function() { var FORCE_TERMINATION_CHARACTERS = ' t<>'"'; var CANNOT_END_WITH_CHARACTERS = '.,;'; var _cachedResult: CharacterClass[] = null; var findLargestCharCode = (str:string):number => { var r = 0; for (var i = 0, len = str.length; i < len; i++) { r = Math.max(r, str.charCodeAt(i)); </del> <ins> let _openParens = '('.charCodeAt(0); let _closeParens = ')'.charCodeAt(0); let _openSquareBracket = '['.charCodeAt(0); let _closeSquareBracket = ']'.charCodeAt(0); let _openCurlyBracket = '{'.charCodeAt(0); let _closeCurlyBracket = '}'.charCodeAt(0); class CharacterClassifier { /** * Maintain a compact (fully initialized ASCII map for quickly classifying ASCII characters - used more often in code). */ private _asciiMap: CharacterClass[]; /** * The entire map (sparse array). */ private _map: CharacterClass[]; constructor() { var FORCE_TERMINATION_CHARACTERS = ' t<>'"、。｡､，．：；？！＠＃＄％＆＊‘“〈《「『【〔（［｛｢｣｝］）〕】』」》〉”’｀～…'; var CANNOT_END_WITH_CHARACTERS = '.,;'; this._asciiMap = []; for (let i = 0; i < 256; i++) { this._asciiMap[i] = CharacterClass.None; </ins> } <del> return r; }; var set = (str:string, toWhat:CharacterClass): void => { for (var i = 0, len = str.length; i < len; i++) { _cachedResult[str.charCodeAt(i)] = toWhat; </del> <ins> this._map = []; for (let i = 0; i < FORCE_TERMINATION_CHARACTERS.length; i++) { this._set(FORCE_TERMINATION_CHARACTERS.charCodeAt(i), CharacterClass.ForceTermination); </ins> } <del> }; return function(): CharacterClass[] { if (_cachedResult === null) { // Find cachedResult size var largestCharCode = Math.max( findLargestCharCode(FORCE_TERMINATION_CHARACTERS), findLargestCharCode(CANNOT_END_WITH_CHARACTERS) ); // Initialize cachedResult _cachedResult = []; for (var i = 0; i < largestCharCode; i++) { _cachedResult[i] = CharacterClass.None; } // Fill in cachedResult set(FORCE_TERMINATION_CHARACTERS, CharacterClass.ForceTermination); set(CANNOT_END_WITH_CHARACTERS, CharacterClass.CannotEndIn); </del> <ins> for (let i = 0; i < CANNOT_END_WITH_CHARACTERS.length; i++) { this._set(CANNOT_END_WITH_CHARACTERS.charCodeAt(i), CharacterClass.CannotEndIn); } } private _set(charCode:number, charClass:CharacterClass): void { if (charCode < 256) { this._asciiMap[charCode] = charClass; </ins> } <ins> this._map[charCode] = charClass; } </ins> <del> return _cachedResult; }; })(); </del> <ins> public classify(charCode:number): CharacterClass { if (charCode < 256) { return this._asciiMap[charCode]; } </ins> <del> let _openParens = '('.charCodeAt(0); let _closeParens = ')'.charCodeAt(0); let _openSquareBracket = '['.charCodeAt(0); let _closeSquareBracket = ']'.charCodeAt(0); let _openCurlyBracket = '{'.charCodeAt(0); let _closeCurlyBracket = '}'.charCodeAt(0); </del> <ins> let charClass = this._map[charCode]; if (charClass) { return charClass; } return CharacterClass.None; } } </ins> class LinkComputer {

Related discussion:
text: VSCode Version: 1.0 OS Version: OS X 10.11.4 I just upgraded my VSCode to 1.0 release. Since it supports Traditional Chinese now, my default language was set to so that some of comments in the newly config file is in Chinese. As you can see in the following screenshot, a Chinese character "", which is equivalent to the period "." in English, was matched as part of valid URL, and it caused VSCode direct to a incorrect URL. ! I have a working fix for this issue, the naive solution is to check if in is greater than 128, which means a non-ASCII character. Why to match only ASCII character? Because when you copy a URL from most of web browsers to clipboard, it will be automatically converted into ASCII-only string. Also, I came up with another idea to modify the to let it cache all the result of ASCII characters (0~127). In this way, we only need to modify the default case of the switch clause in the state machine. Which solution is more preferable? Please give me some advice then I can submit the patch ASAP.