@itwin/appui-abstract 4.0.0-dev.10 → 4.0.0-dev.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +144 -1
- package/lib/cjs/appui-abstract/BaseUiItemsProvider.d.ts +5 -5
- package/lib/cjs/appui-abstract/BaseUiItemsProvider.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/BaseUiItemsProvider.js +4 -3
- package/lib/cjs/appui-abstract/BaseUiItemsProvider.js.map +1 -1
- package/lib/cjs/appui-abstract/UiAdmin.js +1 -1
- package/lib/cjs/appui-abstract/UiAdmin.js.map +1 -1
- package/lib/cjs/appui-abstract/UiItemsManager.d.ts +6 -6
- package/lib/cjs/appui-abstract/UiItemsManager.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/UiItemsManager.js +17 -22
- package/lib/cjs/appui-abstract/UiItemsManager.js.map +1 -1
- package/lib/cjs/appui-abstract/UiItemsProvider.d.ts +5 -4
- package/lib/cjs/appui-abstract/UiItemsProvider.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/UiItemsProvider.js.map +1 -1
- package/lib/cjs/appui-abstract/backstage/BackstageItem.d.ts +3 -3
- package/lib/cjs/appui-abstract/backstage/BackstageItem.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/backstage/BackstageItem.js +3 -3
- package/lib/cjs/appui-abstract/backstage/BackstageItem.js.map +1 -1
- package/lib/cjs/appui-abstract/backstage/BackstageItemsManager.js.map +1 -1
- package/lib/cjs/appui-abstract/content/StandardContentLayouts.js +1 -1
- package/lib/cjs/appui-abstract/content/StandardContentLayouts.js.map +1 -1
- package/lib/cjs/appui-abstract/dialogs/DialogItem.d.ts +1 -1
- package/lib/cjs/appui-abstract/dialogs/DialogItem.js.map +1 -1
- package/lib/cjs/appui-abstract/dialogs/UiLayoutDataProvider.js +1 -1
- package/lib/cjs/appui-abstract/dialogs/UiLayoutDataProvider.js.map +1 -1
- package/lib/cjs/appui-abstract/items/AbstractItemProps.d.ts +1 -1
- package/lib/cjs/appui-abstract/items/AbstractItemProps.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/properties/Description.d.ts +1 -4
- package/lib/cjs/appui-abstract/properties/Description.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/properties/Description.js.map +1 -1
- package/lib/cjs/appui-abstract/properties/EditorParams.d.ts +1 -1
- package/lib/cjs/appui-abstract/properties/EditorParams.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/properties/Value.d.ts +1 -1
- package/lib/cjs/appui-abstract/properties/Value.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/statusbar/StatusBarItem.d.ts +6 -6
- package/lib/cjs/appui-abstract/statusbar/StatusBarItem.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/statusbar/StatusBarItem.js +1 -1
- package/lib/cjs/appui-abstract/statusbar/StatusBarItem.js.map +1 -1
- package/lib/cjs/appui-abstract/statusbar/StatusBarItemsManager.js.map +1 -1
- package/lib/cjs/appui-abstract/toolbars/ToolbarItem.d.ts +5 -5
- package/lib/cjs/appui-abstract/toolbars/ToolbarItem.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/toolbars/ToolbarItem.js +1 -1
- package/lib/cjs/appui-abstract/toolbars/ToolbarItem.js.map +1 -1
- package/lib/cjs/appui-abstract/toolbars/ToolbarItemsManager.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/IconSpecUtilities.d.ts +12 -0
- package/lib/cjs/appui-abstract/utils/IconSpecUtilities.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/utils/IconSpecUtilities.js +20 -1
- package/lib/cjs/appui-abstract/utils/IconSpecUtilities.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/callbacks.d.ts +4 -4
- package/lib/cjs/appui-abstract/utils/callbacks.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/utils/filter/filters.d.ts +3 -3
- package/lib/cjs/appui-abstract/utils/filter/filters.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/utils/filter/filters.js +28 -28
- package/lib/cjs/appui-abstract/utils/filter/filters.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/filter/map.js +15 -17
- package/lib/cjs/appui-abstract/utils/filter/map.js.map +1 -1
- package/lib/cjs/appui-abstract/utils/filter/strings.js +2 -2
- package/lib/cjs/appui-abstract/utils/filter/strings.js.map +1 -1
- package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.d.ts +24 -7
- package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/widget/AbstractWidgetProps.js.map +1 -1
- package/lib/cjs/appui-abstract/widget/StagePanel.d.ts +19 -4
- package/lib/cjs/appui-abstract/widget/StagePanel.d.ts.map +1 -1
- package/lib/cjs/appui-abstract/widget/StagePanel.js +21 -5
- package/lib/cjs/appui-abstract/widget/StagePanel.js.map +1 -1
- package/lib/cjs/appui-abstract.js +5 -1
- package/lib/cjs/appui-abstract.js.map +1 -1
- package/lib/esm/appui-abstract/BaseUiItemsProvider.d.ts +5 -5
- package/lib/esm/appui-abstract/BaseUiItemsProvider.d.ts.map +1 -1
- package/lib/esm/appui-abstract/BaseUiItemsProvider.js +4 -3
- package/lib/esm/appui-abstract/BaseUiItemsProvider.js.map +1 -1
- package/lib/esm/appui-abstract/UiAdmin.js +2 -1
- package/lib/esm/appui-abstract/UiAdmin.js.map +1 -1
- package/lib/esm/appui-abstract/UiItemsManager.d.ts +6 -6
- package/lib/esm/appui-abstract/UiItemsManager.d.ts.map +1 -1
- package/lib/esm/appui-abstract/UiItemsManager.js +18 -22
- package/lib/esm/appui-abstract/UiItemsManager.js.map +1 -1
- package/lib/esm/appui-abstract/UiItemsProvider.d.ts +5 -4
- package/lib/esm/appui-abstract/UiItemsProvider.d.ts.map +1 -1
- package/lib/esm/appui-abstract/UiItemsProvider.js.map +1 -1
- package/lib/esm/appui-abstract/backstage/BackstageItem.d.ts +3 -3
- package/lib/esm/appui-abstract/backstage/BackstageItem.d.ts.map +1 -1
- package/lib/esm/appui-abstract/backstage/BackstageItem.js +4 -3
- package/lib/esm/appui-abstract/backstage/BackstageItem.js.map +1 -1
- package/lib/esm/appui-abstract/backstage/BackstageItemsManager.js.map +1 -1
- package/lib/esm/appui-abstract/content/StandardContentLayouts.js +2 -1
- package/lib/esm/appui-abstract/content/StandardContentLayouts.js.map +1 -1
- package/lib/esm/appui-abstract/dialogs/DialogItem.d.ts +1 -1
- package/lib/esm/appui-abstract/dialogs/DialogItem.js.map +1 -1
- package/lib/esm/appui-abstract/dialogs/UiLayoutDataProvider.js +2 -1
- package/lib/esm/appui-abstract/dialogs/UiLayoutDataProvider.js.map +1 -1
- package/lib/esm/appui-abstract/items/AbstractItemProps.d.ts +1 -1
- package/lib/esm/appui-abstract/items/AbstractItemProps.d.ts.map +1 -1
- package/lib/esm/appui-abstract/properties/Description.d.ts +1 -4
- package/lib/esm/appui-abstract/properties/Description.d.ts.map +1 -1
- package/lib/esm/appui-abstract/properties/Description.js.map +1 -1
- package/lib/esm/appui-abstract/properties/EditorParams.d.ts +1 -1
- package/lib/esm/appui-abstract/properties/EditorParams.d.ts.map +1 -1
- package/lib/esm/appui-abstract/properties/Value.d.ts +1 -1
- package/lib/esm/appui-abstract/properties/Value.d.ts.map +1 -1
- package/lib/esm/appui-abstract/statusbar/StatusBarItem.d.ts +6 -6
- package/lib/esm/appui-abstract/statusbar/StatusBarItem.d.ts.map +1 -1
- package/lib/esm/appui-abstract/statusbar/StatusBarItem.js +2 -1
- package/lib/esm/appui-abstract/statusbar/StatusBarItem.js.map +1 -1
- package/lib/esm/appui-abstract/statusbar/StatusBarItemsManager.js.map +1 -1
- package/lib/esm/appui-abstract/toolbars/ToolbarItem.d.ts +5 -5
- package/lib/esm/appui-abstract/toolbars/ToolbarItem.d.ts.map +1 -1
- package/lib/esm/appui-abstract/toolbars/ToolbarItem.js +2 -1
- package/lib/esm/appui-abstract/toolbars/ToolbarItem.js.map +1 -1
- package/lib/esm/appui-abstract/toolbars/ToolbarItemsManager.js.map +1 -1
- package/lib/esm/appui-abstract/utils/IconSpecUtilities.d.ts +12 -0
- package/lib/esm/appui-abstract/utils/IconSpecUtilities.d.ts.map +1 -1
- package/lib/esm/appui-abstract/utils/IconSpecUtilities.js +21 -1
- package/lib/esm/appui-abstract/utils/IconSpecUtilities.js.map +1 -1
- package/lib/esm/appui-abstract/utils/callbacks.d.ts +4 -4
- package/lib/esm/appui-abstract/utils/callbacks.d.ts.map +1 -1
- package/lib/esm/appui-abstract/utils/filter/filters.d.ts +3 -3
- package/lib/esm/appui-abstract/utils/filter/filters.d.ts.map +1 -1
- package/lib/esm/appui-abstract/utils/filter/filters.js +28 -28
- package/lib/esm/appui-abstract/utils/filter/filters.js.map +1 -1
- package/lib/esm/appui-abstract/utils/filter/map.js +15 -17
- package/lib/esm/appui-abstract/utils/filter/map.js.map +1 -1
- package/lib/esm/appui-abstract/utils/filter/strings.js +2 -2
- package/lib/esm/appui-abstract/utils/filter/strings.js.map +1 -1
- package/lib/esm/appui-abstract/widget/AbstractWidgetProps.d.ts +24 -7
- package/lib/esm/appui-abstract/widget/AbstractWidgetProps.d.ts.map +1 -1
- package/lib/esm/appui-abstract/widget/AbstractWidgetProps.js.map +1 -1
- package/lib/esm/appui-abstract/widget/StagePanel.d.ts +19 -4
- package/lib/esm/appui-abstract/widget/StagePanel.d.ts.map +1 -1
- package/lib/esm/appui-abstract/widget/StagePanel.js +20 -4
- package/lib/esm/appui-abstract/widget/StagePanel.js.map +1 -1
- package/package.json +26 -19
@@ -14,7 +14,7 @@ export interface IMatch {
|
|
14
14
|
* @param wordToMatchAgainst string to search for matches
|
15
15
|
* @internal
|
16
16
|
*/
|
17
|
-
export
|
17
|
+
export type IFilter = (word: string, wordToMatchAgainst: string) => IMatch[] | null;
|
18
18
|
/**
|
19
19
|
* @returns A filter which combines the provided set
|
20
20
|
* of filters with an or. The *first* filters that
|
@@ -77,7 +77,7 @@ export declare function isPatternInWord(patternLow: string, patternPos: number,
|
|
77
77
|
* 2. the offset at which matching started
|
78
78
|
* @internal
|
79
79
|
*/
|
80
|
-
export
|
80
|
+
export type FuzzyScore = [number, number, number];
|
81
81
|
/** @internal */
|
82
82
|
export declare namespace FuzzyScore {
|
83
83
|
/**
|
@@ -89,7 +89,7 @@ export declare namespace FuzzyScore {
|
|
89
89
|
function isDefault(score?: FuzzyScore): score is [-100, 0, 0];
|
90
90
|
}
|
91
91
|
/** @internal */
|
92
|
-
export
|
92
|
+
export type FuzzyScorer = (pattern: string, lowPattern: string, patternPos: number, word: string, lowWord: string, wordPos: number, firstMatchCanBeWeak: boolean) => FuzzyScore | undefined;
|
93
93
|
/** @internal */
|
94
94
|
export declare function fuzzyScore(pattern: string, patternLow: string, patternStart: number, word: string, wordLow: string, wordStart: number, firstMatchCanBeWeak: boolean): FuzzyScore | undefined;
|
95
95
|
/** @internal */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../../../../src/appui-abstract/utils/filter/filters.ts"],"names":[],"mappings":"AAIA;;GAEG;AAYH;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;GAKG;AACH,
|
1
|
+
{"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../../../../src/appui-abstract/utils/filter/filters.ts"],"names":[],"mappings":"AAIA;;GAEG;AAYH;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,KAAK,MAAM,EAAE,GAAG,IAAI,CAAC;AAIpF;;;;;;GAMG;AACH,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAUhD;AAID,gBAAgB;AAChB,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,mBAAmB,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAEhM"}
|
@@ -92,19 +92,19 @@ function _matchesSubString(word, wordToMatchAgainst, i, j) {
|
|
92
92
|
}
|
93
93
|
// CamelCase
|
94
94
|
function isLower(code) {
|
95
|
-
return 97 /* a */ <= code && code <= 122 /* z */;
|
95
|
+
return 97 /* CharCode.a */ <= code && code <= 122 /* CharCode.z */;
|
96
96
|
}
|
97
97
|
function isUpper(code) {
|
98
|
-
return 65 /* A */ <= code && code <= 90 /* Z */;
|
98
|
+
return 65 /* CharCode.A */ <= code && code <= 90 /* CharCode.Z */;
|
99
99
|
}
|
100
100
|
function isNumber(code) {
|
101
|
-
return 48 /* Digit0 */ <= code && code <= 57 /* Digit9 */;
|
101
|
+
return 48 /* CharCode.Digit0 */ <= code && code <= 57 /* CharCode.Digit9 */;
|
102
102
|
}
|
103
103
|
function isWhitespace(code) {
|
104
|
-
return (code === 32 /* Space */
|
105
|
-
|| code === 9 /* Tab */
|
106
|
-
|| code === 10 /* LineFeed */
|
107
|
-
|| code === 13 /* CarriageReturn */);
|
104
|
+
return (code === 32 /* CharCode.Space */
|
105
|
+
|| code === 9 /* CharCode.Tab */
|
106
|
+
|| code === 10 /* CharCode.LineFeed */
|
107
|
+
|| code === 13 /* CharCode.CarriageReturn */);
|
108
108
|
}
|
109
109
|
const wordSeparators = new Set();
|
110
110
|
'`~!@#$%^&*()-=+[{]}\\|;:\'",.<>/?'
|
@@ -399,16 +399,16 @@ function isSeparatorAtPos(value, index) {
|
|
399
399
|
}
|
400
400
|
const code = value.charCodeAt(index);
|
401
401
|
switch (code) {
|
402
|
-
case 95 /* Underline */:
|
403
|
-
case 45 /* Dash */:
|
404
|
-
case 46 /* Period */:
|
405
|
-
case 32 /* Space */:
|
406
|
-
case 47 /* Slash */:
|
407
|
-
case 92 /* Backslash */:
|
408
|
-
case 39 /* SingleQuote */:
|
409
|
-
case 34 /* DoubleQuote */:
|
410
|
-
case 58 /* Colon */:
|
411
|
-
case 36 /* DollarSign */:
|
402
|
+
case 95 /* CharCode.Underline */:
|
403
|
+
case 45 /* CharCode.Dash */:
|
404
|
+
case 46 /* CharCode.Period */:
|
405
|
+
case 32 /* CharCode.Space */:
|
406
|
+
case 47 /* CharCode.Slash */:
|
407
|
+
case 92 /* CharCode.Backslash */:
|
408
|
+
case 39 /* CharCode.SingleQuote */:
|
409
|
+
case 34 /* CharCode.DoubleQuote */:
|
410
|
+
case 58 /* CharCode.Colon */:
|
411
|
+
case 36 /* CharCode.DollarSign */:
|
412
412
|
return true;
|
413
413
|
default:
|
414
414
|
return false;
|
@@ -421,8 +421,8 @@ function isWhitespaceAtPos(value, index) {
|
|
421
421
|
const code = value.charCodeAt(index);
|
422
422
|
switch (code) {
|
423
423
|
// istanbul ignore next
|
424
|
-
case 32 /* Space */:
|
425
|
-
case 9 /* Tab */:
|
424
|
+
case 32 /* CharCode.Space */:
|
425
|
+
case 9 /* CharCode.Tab */:
|
426
426
|
return true;
|
427
427
|
default:
|
428
428
|
return false;
|
@@ -492,30 +492,30 @@ function fuzzyScore(pattern, patternLow, patternStart, word, wordLow, wordStart,
|
|
492
492
|
// left or diag
|
493
493
|
if (left > diag) {
|
494
494
|
_table[row][column] = left;
|
495
|
-
_arrows[row][column] = 4 /* Left */;
|
495
|
+
_arrows[row][column] = 4 /* Arrow.Left */;
|
496
496
|
}
|
497
497
|
else if (left === diag) {
|
498
498
|
_table[row][column] = left;
|
499
|
-
_arrows[row][column] = 4 /* Left */ | 2 /* Diag */;
|
499
|
+
_arrows[row][column] = 4 /* Arrow.Left */ | 2 /* Arrow.Diag */;
|
500
500
|
}
|
501
501
|
else {
|
502
502
|
_table[row][column] = diag;
|
503
|
-
_arrows[row][column] = 2 /* Diag */;
|
503
|
+
_arrows[row][column] = 2 /* Arrow.Diag */;
|
504
504
|
}
|
505
505
|
}
|
506
506
|
else {
|
507
507
|
// top or diag
|
508
508
|
if (top > diag) {
|
509
509
|
_table[row][column] = top;
|
510
|
-
_arrows[row][column] = 1 /* Top */;
|
510
|
+
_arrows[row][column] = 1 /* Arrow.Top */;
|
511
511
|
}
|
512
512
|
else if (top === diag) {
|
513
513
|
_table[row][column] = top;
|
514
|
-
_arrows[row][column] = 1 /* Top */ | 2 /* Diag */;
|
514
|
+
_arrows[row][column] = 1 /* Arrow.Top */ | 2 /* Arrow.Diag */;
|
515
515
|
}
|
516
516
|
else {
|
517
517
|
_table[row][column] = diag;
|
518
|
-
_arrows[row][column] = 2 /* Diag */;
|
518
|
+
_arrows[row][column] = 2 /* Arrow.Diag */;
|
519
519
|
}
|
520
520
|
}
|
521
521
|
}
|
@@ -587,7 +587,7 @@ function _findAllMatches2(row, column, total, matches, lastMatched) {
|
|
587
587
|
while (row > 0 && column > 0) {
|
588
588
|
const score = _scores[row][column];
|
589
589
|
const arrow = _arrows[row][column];
|
590
|
-
if (arrow === 4 /* Left */) {
|
590
|
+
if (arrow === 4 /* Arrow.Left */) {
|
591
591
|
// left -> no match, skip a word character
|
592
592
|
column -= 1;
|
593
593
|
if (lastMatched) {
|
@@ -601,8 +601,8 @@ function _findAllMatches2(row, column, total, matches, lastMatched) {
|
|
601
601
|
}
|
602
602
|
else {
|
603
603
|
/* istanbul ignore else */
|
604
|
-
if (arrow & 2 /* Diag */) {
|
605
|
-
if (arrow & 4 /* Left */) {
|
604
|
+
if (arrow & 2 /* Arrow.Diag */) {
|
605
|
+
if (arrow & 4 /* Arrow.Left */) {
|
606
606
|
// left
|
607
607
|
_findAllMatches2(row, column - 1, matches !== 0 ? total - 1 : total, // gap penalty after first match
|
608
608
|
matches, lastMatched);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../src/appui-abstract/utils/filter/filters.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AASH,+BAAiC;AACjC,qCAAqC;AAkBrC,mBAAmB;AAEnB;;;;;;GAMG;AACH,SAAgB,EAAE,CAAC,GAAG,MAA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AAuB;IACvB,IAAI,UAAU,GAAG,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE;QACpC,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAClC,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;IAEtC,uBAAuB;IACvB,IAAI,KAAK,KAAK,KAAK,EAAE;QACnB,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC;UAC/B,KAAK;UACL,KAAK;UACL,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;AACpC,CAAC;AAED,aAAa","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n\n// file copied from https://github.com/microsoft/vscode/blob/master/src/vs/base/common/filters.ts\n\n/* eslint-disable no-console */\n/* eslint-disable @typescript-eslint/naming-convention */\n/* eslint-disable no-restricted-syntax */\n\nimport { CharCode } from \"./charCode\";\nimport { LRUCache } from \"./map\";\nimport * as strings from \"./strings\";\n\n/** Interface that returns indices of matches\n * @public\n */\nexport interface IMatch {\n start: number;\n end: number;\n}\n\n/**\n * IFilter defines filter function type\n * @param word filter string\n * @param wordToMatchAgainst string to search for matches\n * @internal\n */\nexport type IFilter = (word: string, wordToMatchAgainst: string) => IMatch[] | null;\n\n// Combined filters\n\n/**\n * @returns A filter which combines the provided set\n * of filters with an or. The *first* filters that\n * matches defined the return value of the returned\n * filter.\n * @internal\n */\nexport function or(...filter: IFilter[]): IFilter {\n return function (word: string, wordToMatchAgainst: string): IMatch[] | null {\n for (let i = 0, len = filter.length; i < len; i++) {\n const match = filter[i](word, wordToMatchAgainst);\n if (match) {\n return match;\n }\n }\n return null;\n };\n}\n\n// Prefix\n\n/** @internal */\nexport const matchesStrictPrefix: IFilter = _matchesPrefix.bind(undefined, false);\n/** @internal */\nexport const matchesPrefix: IFilter = _matchesPrefix.bind(undefined, true);\n\nfunction _matchesPrefix(ignoreCase: boolean, word: string, wordToMatchAgainst: string): IMatch[] | null {\n if (!wordToMatchAgainst || wordToMatchAgainst.length < word.length) {\n return null;\n }\n\n let matches: boolean;\n if (ignoreCase) {\n matches = strings.startsWithIgnoreCase(wordToMatchAgainst, word);\n } else {\n matches = wordToMatchAgainst.indexOf(word) === 0;\n }\n\n if (!matches) {\n return null;\n }\n\n return word.length > 0 ? [{ start: 0, end: word.length }] : [];\n}\n\n// Contiguous Substring\n\n/** @internal */\nexport function matchesContiguousSubString(word: string, wordToMatchAgainst: string): IMatch[] | null {\n const index = wordToMatchAgainst.toLowerCase().indexOf(word.toLowerCase());\n if (index === -1) {\n return null;\n }\n\n return [{ start: index, end: index + word.length }];\n}\n\n// Substring\n\n/**\n * Return case insensitive substring matches\n * @param word filter string\n * @param wordToMatchAgainst string to test\n * @internal\n */\nexport function matchesSubString(word: string, wordToMatchAgainst: string): IMatch[] | null {\n return _matchesSubString(word.toLowerCase(), wordToMatchAgainst.toLowerCase(), 0, 0);\n}\n\nfunction _matchesSubString(word: string, wordToMatchAgainst: string, i: number, j: number): IMatch[] | null {\n if (i === word.length) {\n return [];\n } else if (j === wordToMatchAgainst.length) {\n return null;\n } else {\n if (word[i] === wordToMatchAgainst[j]) {\n let result: IMatch[] | null = null;\n if (result = _matchesSubString(word, wordToMatchAgainst, i + 1, j + 1)) {\n return join({ start: j, end: j + 1 }, result);\n }\n return null;\n }\n\n return _matchesSubString(word, wordToMatchAgainst, i, j + 1);\n }\n}\n\n// CamelCase\n\nfunction isLower(code: number): boolean {\n return CharCode.a <= code && code <= CharCode.z;\n}\n\nfunction isUpper(code: number): boolean {\n return CharCode.A <= code && code <= CharCode.Z;\n}\n\nfunction isNumber(code: number): boolean {\n return CharCode.Digit0 <= code && code <= CharCode.Digit9;\n}\n\nfunction isWhitespace(code: number): boolean {\n return (\n code === CharCode.Space\n || code === CharCode.Tab\n || code === CharCode.LineFeed\n || code === CharCode.CarriageReturn\n );\n}\n\nconst wordSeparators = new Set<number>();\n'`~!@#$%^&*()-=+[{]}\\\\|;:\\'\",.<>/?'\n .split(\"\")\n .forEach((s) => wordSeparators.add(s.charCodeAt(0)));\n\nfunction isWordSeparator(code: number): boolean {\n return isWhitespace(code) || wordSeparators.has(code);\n}\n\nfunction charactersMatch(codeA: number, codeB: number): boolean {\n return (codeA === codeB) || (isWordSeparator(codeA) && isWordSeparator(codeB));\n}\n\nfunction isAlphanumeric(code: number): boolean {\n return isLower(code) || isUpper(code) || isNumber(code);\n}\n\nfunction join(head: IMatch, tail: IMatch[]): IMatch[] {\n if (tail.length === 0) {\n tail = [head];\n } else if (head.end === tail[0].start) {\n tail[0].start = head.start;\n } else {\n tail.unshift(head);\n }\n return tail;\n}\n\nfunction nextAnchor(camelCaseWord: string, start: number): number {\n for (let i = start; i < camelCaseWord.length; i++) {\n const c = camelCaseWord.charCodeAt(i);\n if (isUpper(c) || isNumber(c) || (i > 0 && !isAlphanumeric(camelCaseWord.charCodeAt(i - 1)))) {\n return i;\n }\n }\n return camelCaseWord.length;\n}\n\nfunction _matchesCamelCase(word: string, camelCaseWord: string, i: number, j: number): IMatch[] | null {\n if (i === word.length) {\n return [];\n } else if (j === camelCaseWord.length) {\n return null;\n } else if (word[i] !== camelCaseWord[j].toLowerCase()) {\n return null;\n } else {\n let result: IMatch[] | null = null;\n let nextUpperIndex = j + 1;\n result = _matchesCamelCase(word, camelCaseWord, i + 1, j + 1);\n while (!result && (nextUpperIndex = nextAnchor(camelCaseWord, nextUpperIndex)) < camelCaseWord.length) {\n result = _matchesCamelCase(word, camelCaseWord, i + 1, nextUpperIndex);\n nextUpperIndex++;\n }\n return result === null ? null : join({ start: j, end: j + 1 }, result);\n }\n}\n\ninterface ICamelCaseAnalysis {\n upperPercent: number;\n lowerPercent: number;\n alphaPercent: number;\n numericPercent: number;\n}\n\n// Heuristic to avoid computing camel case matcher for words that don't\n// look like camelCaseWords.\nfunction analyzeCamelCaseWord(word: string): ICamelCaseAnalysis {\n let upper = 0, lower = 0, alpha = 0, numeric = 0, code = 0;\n\n for (let i = 0; i < word.length; i++) {\n code = word.charCodeAt(i);\n\n if (isUpper(code)) { upper++; }\n if (isLower(code)) { lower++; }\n if (isAlphanumeric(code)) { alpha++; }\n if (isNumber(code)) { numeric++; }\n }\n\n const upperPercent = upper / word.length;\n const lowerPercent = lower / word.length;\n const alphaPercent = alpha / word.length;\n const numericPercent = numeric / word.length;\n\n return { upperPercent, lowerPercent, alphaPercent, numericPercent };\n}\n\nfunction isUpperCaseWord(analysis: ICamelCaseAnalysis): boolean {\n const { upperPercent, lowerPercent } = analysis;\n return lowerPercent === 0 && upperPercent > 0.6;\n}\n\nfunction isCamelCaseWord(analysis: ICamelCaseAnalysis): boolean {\n const { upperPercent, lowerPercent, alphaPercent, numericPercent } = analysis;\n return lowerPercent > 0.2 && upperPercent < 0.8 && alphaPercent > 0.6 && numericPercent < 0.2;\n}\n\n// Heuristic to avoid computing camel case matcher for words that don't\n// look like camel case patterns.\nfunction isCamelCasePattern(word: string): boolean {\n let upper = 0, lower = 0, code = 0, whitespace = 0;\n\n for (let i = 0; i < word.length; i++) {\n code = word.charCodeAt(i);\n\n if (isUpper(code)) { upper++; }\n if (isLower(code)) { lower++; }\n if (isWhitespace(code)) { whitespace++; }\n }\n\n if ((upper === 0 || lower === 0) && whitespace === 0) {\n return word.length <= 30;\n } else {\n return upper <= 5;\n }\n}\n\n/**\n * Return matches treating \"camelCase\" words separately. For example the filter string \"gp\" would return two matches in string \"Git Pull\".\n * @param word filter string\n * @param wordToMatchAgainst string to test\n * @internal\n */\nexport function matchesCamelCase(word: string, camelCaseWord: string): IMatch[] | null {\n if (!camelCaseWord) {\n return null;\n }\n\n camelCaseWord = camelCaseWord.trim();\n\n if (camelCaseWord.length === 0) {\n return null;\n }\n\n if (!isCamelCasePattern(camelCaseWord)) {\n return null;\n }\n\n if (camelCaseWord.length > 60) {\n return null;\n }\n\n const analysis = analyzeCamelCaseWord(camelCaseWord);\n\n if (!isCamelCaseWord(analysis)) {\n // istanbul ignore next\n if (!isUpperCaseWord(analysis)) {\n return null;\n }\n\n camelCaseWord = camelCaseWord.toLowerCase();\n }\n\n let result: IMatch[] | null = null;\n let i = 0;\n\n word = word.toLowerCase();\n while (i < camelCaseWord.length && (result = _matchesCamelCase(word, camelCaseWord, 0, i)) === null) {\n i = nextAnchor(camelCaseWord, i + 1);\n }\n\n return result;\n}\n\n/**\n * Matches beginning of words supporting non-ASCII languages.\n * @param word Filter string\n * @param target String being searched\n * @param contiguous - If true the filter string must be found \"contiguous\" in the searched string (E.g. \"pul\" will match \"Git: Pull\").\n * Otherwise also matches sub string of the word with beginnings of the words in the target (e.g. \"gp\" or \"g p\" will match \"Git: Pull\").\n * Useful in cases where the target is words (e.g. command labels)\n * @internal\n */\nexport function matchesWords(word: string, target: string, contiguous: boolean = false): IMatch[] | null {\n if (!target || target.length === 0) {\n return null;\n }\n\n let result: IMatch[] | null = null;\n let i = 0;\n\n word = word.toLowerCase();\n target = target.toLowerCase();\n while (i < target.length && (result = _matchesWords(word, target, 0, i, contiguous)) === null) {\n i = nextWord(target, i + 1);\n }\n\n return result;\n}\n\nfunction _matchesWords(word: string, target: string, i: number, j: number, contiguous: boolean): IMatch[] | null {\n if (i === word.length) {\n return [];\n } else if (j === target.length) {\n return null;\n } else if (!charactersMatch(word.charCodeAt(i), target.charCodeAt(j))) {\n return null;\n } else {\n let result: IMatch[] | null = null;\n let nextWordIndex = j + 1;\n result = _matchesWords(word, target, i + 1, j + 1, contiguous);\n // istanbul ignore else\n if (!contiguous) {\n while (!result && (nextWordIndex = nextWord(target, nextWordIndex)) < target.length) {\n result = _matchesWords(word, target, i + 1, nextWordIndex, contiguous);\n nextWordIndex++;\n }\n }\n return result === null ? null : join({ start: j, end: j + 1 }, result);\n }\n}\n\nfunction nextWord(word: string, start: number): number {\n for (let i = start; i < word.length; i++) {\n if (isWordSeparator(word.charCodeAt(i)) ||\n (i > 0 && isWordSeparator(word.charCodeAt(i - 1)))) {\n return i;\n }\n }\n return word.length;\n}\n\n// Fuzzy\n\nconst fuzzyContiguousFilter = or(matchesPrefix, matchesCamelCase, matchesContiguousSubString);\nconst fuzzySeparateFilter = or(matchesPrefix, matchesCamelCase, matchesSubString);\nconst fuzzyRegExpCache = new LRUCache<string, RegExp>(10000); // bounded to 10000 elements\n\n/**\n * Match pattern against word in a fuzzy way. This will only return a single match.\n * @internal\n */\nexport function matchesFuzzy(word: string, wordToMatchAgainst: string, enableSeparateSubstringMatching = false): IMatch[] | null {\n // istanbul ignore next\n if (typeof word !== \"string\" || typeof wordToMatchAgainst !== \"string\") {\n return null; // return early for invalid input\n }\n\n // Form RegExp for wildcard matches\n let regexp = fuzzyRegExpCache.get(word);\n if (!regexp) {\n regexp = new RegExp(strings.convertSimple2RegExpPattern(word), \"i\");\n fuzzyRegExpCache.set(word, regexp);\n }\n\n // RegExp Filter\n const match = regexp.exec(wordToMatchAgainst);\n if (match) {\n return [{ start: match.index, end: match.index + match[0].length }];\n }\n\n // Default Filter\n return enableSeparateSubstringMatching ? /* istanbul ignore next */ fuzzySeparateFilter(word, wordToMatchAgainst) : fuzzyContiguousFilter(word, wordToMatchAgainst);\n}\n\n/**\n * Match pattern against word in a fuzzy way. As in IntelliSense and faster and more\n * powerful than `matchesFuzzy`. This will only return a single match.\n * @internal\n */\nexport function matchesFuzzy2(pattern: string, word: string): IMatch[] | null {\n const score = fuzzyScore(pattern, pattern.toLowerCase(), 0, word, word.toLowerCase(), 0, true);\n return score ? createMatches(score) : null;\n}\n\n// #region --- fuzzyScore ---\n/**\n * @internal\n */\nexport function createMatches(score: undefined | FuzzyScore): IMatch[] {\n // istanbul ignore next\n if (typeof score === \"undefined\") {\n return [];\n }\n\n const matches = score[1].toString(2);\n const wordStart = score[2];\n const res: IMatch[] = [];\n\n for (let pos = wordStart; pos < _maxLen; pos++) {\n if (matches[matches.length - (pos + 1)] === \"1\") {\n const last = res[res.length - 1];\n if (last && last.end === pos) {\n last.end = pos + 1;\n } else {\n res.push({ start: pos, end: pos + 1 });\n }\n }\n }\n return res;\n}\n\nconst _maxLen = 128;\n\nfunction initTable() {\n const table: number[][] = [];\n const row: number[] = [0];\n for (let i = 1; i <= _maxLen; i++) {\n row.push(-i);\n }\n for (let i = 0; i <= _maxLen; i++) {\n const thisRow = row.slice(0);\n thisRow[0] = -i;\n table.push(thisRow);\n }\n return table;\n}\n\nconst _table = initTable();\nconst _scores = initTable();\n// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\nconst _arrows = <Arrow[][]>initTable();\nconst _debug = false;\n\nfunction isSeparatorAtPos(value: string, index: number): boolean {\n if (index < 0 || index >= value.length) {\n return false;\n }\n const code = value.charCodeAt(index);\n switch (code) {\n case CharCode.Underline:\n case CharCode.Dash:\n case CharCode.Period:\n case CharCode.Space:\n case CharCode.Slash:\n case CharCode.Backslash:\n case CharCode.SingleQuote:\n case CharCode.DoubleQuote:\n case CharCode.Colon:\n case CharCode.DollarSign:\n return true;\n default:\n return false;\n }\n}\n\nfunction isWhitespaceAtPos(value: string, index: number): boolean {\n if (index < 0 || index >= value.length) {\n return false;\n }\n const code = value.charCodeAt(index);\n switch (code) {\n // istanbul ignore next\n case CharCode.Space:\n case CharCode.Tab:\n return true;\n default:\n return false;\n }\n}\n\nfunction isUpperCaseAtPos(pos: number, word: string, wordLow: string): boolean {\n return word[pos] !== wordLow[pos];\n}\n\n/** @internal */\nexport function isPatternInWord(patternLow: string, patternPos: number, patternLen: number, wordLow: string, wordPos: number, wordLen: number): boolean {\n while (patternPos < patternLen && wordPos < wordLen) {\n if (patternLow[patternPos] === wordLow[wordPos]) {\n patternPos += 1;\n }\n wordPos += 1;\n }\n return patternPos === patternLen; // pattern must be exhausted\n}\n\nconst enum Arrow { Top = 0b1, Diag = 0b10, Left = 0b100 }\n\n/**\n * A tuple of three values.\n * 0. the score\n * 1. the matches encoded as bitmask (2^53)\n * 2. the offset at which matching started\n * @internal\n */\nexport type FuzzyScore = [number, number, number];\n\n/** @internal */\nexport namespace FuzzyScore { // eslint-disable-line @typescript-eslint/no-redeclare\n /**\n * No matches and value `-100`\n * @internal\n */\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n export const Default: [-100, 0, 0] = <[-100, 0, 0]>Object.freeze([-100, 0, 0]);\n\n // istanbul ignore next\n /** @internal */\n export function isDefault(score?: FuzzyScore): score is [-100, 0, 0] {\n return !score || (score[0] === -100 && score[1] === 0 && score[2] === 0);\n }\n}\n\n/** @internal */\nexport type FuzzyScorer = (pattern: string, lowPattern: string, patternPos: number, word: string, lowWord: string, wordPos: number, firstMatchCanBeWeak: boolean) => FuzzyScore | undefined;\n\n/** @internal */\nexport function fuzzyScore(pattern: string, patternLow: string, patternStart: number, word: string, wordLow: string, wordStart: number, firstMatchCanBeWeak: boolean): FuzzyScore | undefined {\n // istanbul ignore next\n const patternLen = pattern.length > _maxLen ? _maxLen : pattern.length;\n const wordLen = word.length > _maxLen ? _maxLen : word.length;\n\n if (patternStart >= patternLen || wordStart >= wordLen || (patternLen - patternStart) > (wordLen - wordStart)) {\n return undefined;\n }\n\n // Run a simple check if the characters of pattern occur\n // (in order) at all in word. If that isn't the case we\n // stop because no match will be possible\n if (!isPatternInWord(patternLow, patternStart, patternLen, wordLow, wordStart, wordLen)) {\n return undefined;\n }\n\n let row: number = 1;\n let column: number = 1;\n let patternPos = patternStart;\n let wordPos = wordStart;\n\n let hasStrongFirstMatch = false;\n\n // There will be a match, fill in tables\n for (row = 1, patternPos = patternStart; patternPos < patternLen; row++, patternPos++) {\n\n for (column = 1, wordPos = wordStart; wordPos < wordLen; column++, wordPos++) {\n\n const score = _doScore(pattern, patternLow, patternPos, patternStart, word, wordLow, wordPos);\n\n if (patternPos === patternStart && score > 1) {\n hasStrongFirstMatch = true;\n }\n\n _scores[row][column] = score;\n\n const diag = _table[row - 1][column - 1] + (score > 1 ? 1 : score);\n const top = _table[row - 1][column] + -1;\n const left = _table[row][column - 1] + -1;\n\n if (left >= top) {\n // left or diag\n if (left > diag) {\n _table[row][column] = left;\n _arrows[row][column] = Arrow.Left;\n } else if (left === diag) {\n _table[row][column] = left;\n _arrows[row][column] = Arrow.Left | Arrow.Diag;\n } else {\n _table[row][column] = diag;\n _arrows[row][column] = Arrow.Diag;\n }\n } else {\n // top or diag\n if (top > diag) {\n _table[row][column] = top;\n _arrows[row][column] = Arrow.Top;\n } else if (top === diag) {\n _table[row][column] = top;\n _arrows[row][column] = Arrow.Top | Arrow.Diag;\n } else {\n _table[row][column] = diag;\n _arrows[row][column] = Arrow.Diag;\n }\n }\n }\n }\n\n if (!hasStrongFirstMatch && !firstMatchCanBeWeak) {\n return undefined;\n }\n\n _matchesCount = 0;\n _topScore = -100;\n _wordStart = wordStart;\n _firstMatchCanBeWeak = firstMatchCanBeWeak;\n\n _findAllMatches2(row - 1, column - 1, patternLen === wordLen ? 1 : 0, 0, false);\n if (_matchesCount === 0) {\n return undefined;\n }\n\n return [_topScore, _topMatch2, wordStart];\n}\n\nfunction _doScore(pattern: string, patternLow: string, patternPos: number, patternStart: number, word: string, wordLow: string, wordPos: number) {\n if (patternLow[patternPos] !== wordLow[wordPos]) {\n return -1;\n }\n if (wordPos === (patternPos - patternStart)) {\n // common prefix: `foobar <-> foobaz`\n // ^^^^^\n if (pattern[patternPos] === word[wordPos]) {\n return 7;\n } else {\n return 5;\n }\n } else if (isUpperCaseAtPos(wordPos, word, wordLow) && (wordPos === 0 || !isUpperCaseAtPos(wordPos - 1, word, wordLow))) {\n // hitting upper-case: `foo <-> forOthers`\n // ^^ ^\n if (pattern[patternPos] === word[wordPos]) {\n return 7;\n } else {\n return 5;\n }\n } else if (isSeparatorAtPos(wordLow, wordPos) && (wordPos === 0 || !isSeparatorAtPos(wordLow, wordPos - 1))) {\n // hitting a separator: `. <-> foo.bar`\n // ^\n return 5;\n\n } else if (isSeparatorAtPos(wordLow, wordPos - 1) || isWhitespaceAtPos(wordLow, wordPos - 1)) {\n // post separator: `foo <-> bar_foo`\n // ^^^\n return 5;\n\n } else {\n return 1;\n }\n}\n\nlet _matchesCount: number = 0;\nlet _topMatch2: number = 0;\nlet _topScore: number = 0;\nlet _wordStart: number = 0;\nlet _firstMatchCanBeWeak: boolean = false;\n\nfunction _findAllMatches2(row: number, column: number, total: number, matches: number, lastMatched: boolean): void {\n\n if (_matchesCount >= 10 || total < -25) {\n // stop when having already 10 results, or\n // when a potential alignment as already 5 gaps\n return;\n }\n\n let simpleMatchCount = 0;\n\n while (row > 0 && column > 0) {\n\n const score = _scores[row][column];\n const arrow = _arrows[row][column];\n\n if (arrow === Arrow.Left) {\n // left -> no match, skip a word character\n column -= 1;\n if (lastMatched) {\n total -= 5; // new gap penalty\n } else if (matches !== 0) {\n total -= 1; // gap penalty after first match\n }\n lastMatched = false;\n simpleMatchCount = 0;\n } else {\n /* istanbul ignore else */\n if (arrow & Arrow.Diag) {\n if (arrow & Arrow.Left) {\n // left\n _findAllMatches2(\n row,\n column - 1,\n matches !== 0 ? total - 1 : total, // gap penalty after first match\n matches,\n lastMatched\n );\n }\n\n // diag\n total += score;\n row -= 1;\n column -= 1;\n lastMatched = true;\n\n // match -> set a 1 at the word pos\n matches += 2 ** (column + _wordStart);\n\n // count simple matches and boost a row of\n // simple matches when they yield in a\n // strong match.\n if (score === 1) {\n simpleMatchCount += 1;\n\n if (row === 0 && !_firstMatchCanBeWeak) {\n // when the first match is a weak\n // match we discard it\n return undefined;\n }\n\n } else {\n // boost\n total += 1 + (simpleMatchCount * (score - 1));\n simpleMatchCount = 0;\n }\n\n } else {\n // istanbul ignore next\n return undefined;\n }\n }\n }\n\n total -= column >= 3 ? 9 : column * 3; // late start penalty\n\n // dynamically keep track of the current top score\n // and insert the current best score at head, the rest at tail\n _matchesCount += 1;\n if (total > _topScore) {\n _topScore = total;\n _topMatch2 = matches;\n }\n}\n\n// #endregion\n\n// #region --- graceful ---\n/** @internal */\nexport function fuzzyScoreGracefulAggressive(pattern: string, lowPattern: string, patternPos: number, word: string, lowWord: string, wordPos: number, firstMatchCanBeWeak: boolean): FuzzyScore | undefined {\n return fuzzyScoreWithPermutations(pattern, lowPattern, patternPos, word, lowWord, wordPos, true, firstMatchCanBeWeak);\n}\n\n/** @internal */\nexport function fuzzyScoreGraceful(pattern: string, lowPattern: string, patternPos: number, word: string, lowWord: string, wordPos: number, firstMatchCanBeWeak: boolean): FuzzyScore | undefined {\n return fuzzyScoreWithPermutations(pattern, lowPattern, patternPos, word, lowWord, wordPos, false, firstMatchCanBeWeak);\n}\n\nfunction fuzzyScoreWithPermutations(pattern: string, lowPattern: string, patternPos: number, word: string, lowWord: string, wordPos: number, aggressive: boolean, firstMatchCanBeWeak: boolean): FuzzyScore | undefined {\n let top = fuzzyScore(pattern, lowPattern, patternPos, word, lowWord, wordPos, firstMatchCanBeWeak);\n\n if (top && !aggressive) {\n // when using the original pattern yield a result we`\n // return it unless we are aggressive and try to find\n // a better alignment, e.g. `cno` -> `^co^ns^ole` or `^c^o^nsole`.\n return top;\n }\n\n // istanbul ignore else\n if (pattern.length >= 3) {\n // When the pattern is long enough then try a few (max 7)\n // permutations of the pattern to find a better match. The\n // permutations only swap neighbouring characters, e.g\n // `cnoso` becomes `conso`, `cnsoo`, `cnoos`.\n const tries = Math.min(7, pattern.length - 1);\n for (let movingPatternPos = patternPos + 1; movingPatternPos < tries; movingPatternPos++) {\n const newPattern = nextTypoPermutation(pattern, movingPatternPos);\n // istanbul ignore else\n if (newPattern) {\n const candidate = fuzzyScore(newPattern, newPattern.toLowerCase(), patternPos, word, lowWord, wordPos, firstMatchCanBeWeak);\n if (candidate) {\n candidate[0] -= 3; // permutation penalty\n // istanbul ignore else\n if (!top || candidate[0] > top[0]) {\n top = candidate;\n }\n }\n }\n }\n }\n\n return top;\n}\n\nfunction nextTypoPermutation(pattern: string, patternPos: number): string | undefined {\n\n // istanbul ignore next\n if (patternPos + 1 >= pattern.length) {\n return undefined;\n }\n\n const swap1 = pattern[patternPos];\n const swap2 = pattern[patternPos + 1];\n\n // istanbul ignore next\n if (swap1 === swap2) {\n return undefined;\n }\n\n return pattern.slice(0, patternPos)\n + swap2\n + swap1\n + pattern.slice(patternPos + 2);\n}\n\n// #endregion\n"]}
|
1
|
+
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../src/appui-abstract/utils/filter/filters.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AASH,+BAAiC;AACjC,qCAAqC;AAkBrC,mBAAmB;AAEnB;;;;;;GAMG;AACH,SAAgB,EAAE,CAAC,GAAG,MAAiB;IACrC,OAAO,UAAU,IAAY,EAAE,kBAA0B;QACvD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;YACjD,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC;YAClD,IAAI,KAAK,EAAE;gBACT,OAAO,KAAK,CAAC;aACd;SACF;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AAVD,gBAUC;AAED,SAAS;AAET,gBAAgB;AACH,QAAA,mBAAmB,GAAY,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AAClF,gBAAgB;AACH,QAAA,aAAa,GAAY,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAE3E,SAAS,cAAc,CAAC,UAAmB,EAAE,IAAY,EAAE,kBAA0B;IACnF,IAAI,CAAC,kBAAkB,IAAI,kBAAkB,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;QAClE,OAAO,IAAI,CAAC;KACb;IAED,IAAI,OAAgB,CAAC;IACrB,IAAI,UAAU,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AAU,CAAC,UAAU,EAAE,UAAU,CAAC,WAAW,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,mBAAmB,CAAC,CAAC;gBAC5H,IAAI,SAAS,EAAE;oBACb,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,sBAAsB;oBACzC,uBAAuB;oBACvB,IAAI,CAAC,GAAG,IAAI,SAAS,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE;wBACjC,GAAG,GAAG,SAAS,CAAC;qBACjB;iBACF;aACF;SACF;KACF;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,mBAAmB,CAAC,OAAe,EAAE,UAAkB;IAE9D,uBAAuB;IACvB,IAAI,UAAU,GAAG,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE;QACpC,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAClC,MAAM,KAAK,GAAG,OAAO,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;IAEtC,uBAAuB;IACvB,IAAI,KAAK,KAAK,KAAK,EAAE;QACnB,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC;UAC/B,KAAK;UACL,KAAK;UACL,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;AACpC,CAAC;AAED,aAAa","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utilities\n */\n\n// file copied from https://github.com/microsoft/vscode/blob/master/src/vs/base/common/filters.ts\n\n/* eslint-disable no-console */\n/* eslint-disable @typescript-eslint/naming-convention */\n/* eslint-disable no-restricted-syntax */\n\nimport { CharCode } from \"./charCode\";\nimport { LRUCache } from \"./map\";\nimport * as strings from \"./strings\";\n\n/** Interface that returns indices of matches\n * @public\n */\nexport interface IMatch {\n start: number;\n end: number;\n}\n\n/**\n * IFilter defines filter function type\n * @param word filter string\n * @param wordToMatchAgainst string to search for matches\n * @internal\n */\nexport type IFilter = (word: string, wordToMatchAgainst: string) => IMatch[] | null;\n\n// Combined filters\n\n/**\n * @returns A filter which combines the provided set\n * of filters with an or. The *first* filters that\n * matches defined the return value of the returned\n * filter.\n * @internal\n */\nexport function or(...filter: IFilter[]): IFilter {\n return function (word: string, wordToMatchAgainst: string): IMatch[] | null {\n for (let i = 0, len = filter.length; i < len; i++) {\n const match = filter[i](word, wordToMatchAgainst);\n if (match) {\n return match;\n }\n }\n return null;\n };\n}\n\n// Prefix\n\n/** @internal */\nexport const matchesStrictPrefix: IFilter = _matchesPrefix.bind(undefined, false);\n/** @internal */\nexport const matchesPrefix: IFilter = _matchesPrefix.bind(undefined, true);\n\nfunction _matchesPrefix(ignoreCase: boolean, word: string, wordToMatchAgainst: string): IMatch[] | null {\n if (!wordToMatchAgainst || wordToMatchAgainst.length < word.length) {\n return null;\n }\n\n let matches: boolean;\n if (ignoreCase) {\n matches = strings.startsWithIgnoreCase(wordToMatchAgainst, word);\n } else {\n matches = wordToMatchAgainst.indexOf(word) === 0;\n }\n\n if (!matches) {\n return null;\n }\n\n return word.length > 0 ? [{ start: 0, end: word.length }] : [];\n}\n\n// Contiguous Substring\n\n/** @internal */\nexport function matchesContiguousSubString(word: string, wordToMatchAgainst: string): IMatch[] | null {\n const index = wordToMatchAgainst.toLowerCase().indexOf(word.toLowerCase());\n if (index === -1) {\n return null;\n }\n\n return [{ start: index, end: index + word.length }];\n}\n\n// Substring\n\n/**\n * Return case insensitive substring matches\n * @param word filter string\n * @param wordToMatchAgainst string to test\n * @internal\n */\nexport function matchesSubString(word: string, wordToMatchAgainst: string): IMatch[] | null {\n return _matchesSubString(word.toLowerCase(), wordToMatchAgainst.toLowerCase(), 0, 0);\n}\n\nfunction _matchesSubString(word: string, wordToMatchAgainst: string, i: number, j: number): IMatch[] | null {\n if (i === word.length) {\n return [];\n } else if (j === wordToMatchAgainst.length) {\n return null;\n } else {\n if (word[i] === wordToMatchAgainst[j]) {\n let result: IMatch[] | null = null;\n if (result = _matchesSubString(word, wordToMatchAgainst, i + 1, j + 1)) {\n return join({ start: j, end: j + 1 }, result);\n }\n return null;\n }\n\n return _matchesSubString(word, wordToMatchAgainst, i, j + 1);\n }\n}\n\n// CamelCase\n\nfunction isLower(code: number): boolean {\n return CharCode.a <= code && code <= CharCode.z;\n}\n\nfunction isUpper(code: number): boolean {\n return CharCode.A <= code && code <= CharCode.Z;\n}\n\nfunction isNumber(code: number): boolean {\n return CharCode.Digit0 <= code && code <= CharCode.Digit9;\n}\n\nfunction isWhitespace(code: number): boolean {\n return (\n code === CharCode.Space\n || code === CharCode.Tab\n || code === CharCode.LineFeed\n || code === CharCode.CarriageReturn\n );\n}\n\nconst wordSeparators = new Set<number>();\n'`~!@#$%^&*()-=+[{]}\\\\|;:\\'\",.<>/?'\n .split(\"\")\n .forEach((s) => wordSeparators.add(s.charCodeAt(0)));\n\nfunction isWordSeparator(code: number): boolean {\n return isWhitespace(code) || wordSeparators.has(code);\n}\n\nfunction charactersMatch(codeA: number, codeB: number): boolean {\n return (codeA === codeB) || (isWordSeparator(codeA) && isWordSeparator(codeB));\n}\n\nfunction isAlphanumeric(code: number): boolean {\n return isLower(code) || isUpper(code) || isNumber(code);\n}\n\nfunction join(head: IMatch, tail: IMatch[]): IMatch[] {\n if (tail.length === 0) {\n tail = [head];\n } else if (head.end === tail[0].start) {\n tail[0].start = head.start;\n } else {\n tail.unshift(head);\n }\n return tail;\n}\n\nfunction nextAnchor(camelCaseWord: string, start: number): number {\n for (let i = start; i < camelCaseWord.length; i++) {\n const c = camelCaseWord.charCodeAt(i);\n if (isUpper(c) || isNumber(c) || (i > 0 && !isAlphanumeric(camelCaseWord.charCodeAt(i - 1)))) {\n return i;\n }\n }\n return camelCaseWord.length;\n}\n\nfunction _matchesCamelCase(word: string, camelCaseWord: string, i: number, j: number): IMatch[] | null {\n if (i === word.length) {\n return [];\n } else if (j === camelCaseWord.length) {\n return null;\n } else if (word[i] !== camelCaseWord[j].toLowerCase()) {\n return null;\n } else {\n let result: IMatch[] | null = null;\n let nextUpperIndex = j + 1;\n result = _matchesCamelCase(word, camelCaseWord, i + 1, j + 1);\n while (!result && (nextUpperIndex = nextAnchor(camelCaseWord, nextUpperIndex)) < camelCaseWord.length) {\n result = _matchesCamelCase(word, camelCaseWord, i + 1, nextUpperIndex);\n nextUpperIndex++;\n }\n return result === null ? null : join({ start: j, end: j + 1 }, result);\n }\n}\n\ninterface ICamelCaseAnalysis {\n upperPercent: number;\n lowerPercent: number;\n alphaPercent: number;\n numericPercent: number;\n}\n\n// Heuristic to avoid computing camel case matcher for words that don't\n// look like camelCaseWords.\nfunction analyzeCamelCaseWord(word: string): ICamelCaseAnalysis {\n let upper = 0, lower = 0, alpha = 0, numeric = 0, code = 0;\n\n for (let i = 0; i < word.length; i++) {\n code = word.charCodeAt(i);\n\n if (isUpper(code)) { upper++; }\n if (isLower(code)) { lower++; }\n if (isAlphanumeric(code)) { alpha++; }\n if (isNumber(code)) { numeric++; }\n }\n\n const upperPercent = upper / word.length;\n const lowerPercent = lower / word.length;\n const alphaPercent = alpha / word.length;\n const numericPercent = numeric / word.length;\n\n return { upperPercent, lowerPercent, alphaPercent, numericPercent };\n}\n\nfunction isUpperCaseWord(analysis: ICamelCaseAnalysis): boolean {\n const { upperPercent, lowerPercent } = analysis;\n return lowerPercent === 0 && upperPercent > 0.6;\n}\n\nfunction isCamelCaseWord(analysis: ICamelCaseAnalysis): boolean {\n const { upperPercent, lowerPercent, alphaPercent, numericPercent } = analysis;\n return lowerPercent > 0.2 && upperPercent < 0.8 && alphaPercent > 0.6 && numericPercent < 0.2;\n}\n\n// Heuristic to avoid computing camel case matcher for words that don't\n// look like camel case patterns.\nfunction isCamelCasePattern(word: string): boolean {\n let upper = 0, lower = 0, code = 0, whitespace = 0;\n\n for (let i = 0; i < word.length; i++) {\n code = word.charCodeAt(i);\n\n if (isUpper(code)) { upper++; }\n if (isLower(code)) { lower++; }\n if (isWhitespace(code)) { whitespace++; }\n }\n\n if ((upper === 0 || lower === 0) && whitespace === 0) {\n return word.length <= 30;\n } else {\n return upper <= 5;\n }\n}\n\n/**\n * Return matches treating \"camelCase\" words separately. For example the filter string \"gp\" would return two matches in string \"Git Pull\".\n * @param word filter string\n * @param wordToMatchAgainst string to test\n * @internal\n */\nexport function matchesCamelCase(word: string, camelCaseWord: string): IMatch[] | null {\n if (!camelCaseWord) {\n return null;\n }\n\n camelCaseWord = camelCaseWord.trim();\n\n if (camelCaseWord.length === 0) {\n return null;\n }\n\n if (!isCamelCasePattern(camelCaseWord)) {\n return null;\n }\n\n if (camelCaseWord.length > 60) {\n return null;\n }\n\n const analysis = analyzeCamelCaseWord(camelCaseWord);\n\n if (!isCamelCaseWord(analysis)) {\n // istanbul ignore next\n if (!isUpperCaseWord(analysis)) {\n return null;\n }\n\n camelCaseWord = camelCaseWord.toLowerCase();\n }\n\n let result: IMatch[] | null = null;\n let i = 0;\n\n word = word.toLowerCase();\n while (i < camelCaseWord.length && (result = _matchesCamelCase(word, camelCaseWord, 0, i)) === null) {\n i = nextAnchor(camelCaseWord, i + 1);\n }\n\n return result;\n}\n\n/**\n * Matches beginning of words supporting non-ASCII languages.\n * @param word Filter string\n * @param target String being searched\n * @param contiguous - If true the filter string must be found \"contiguous\" in the searched string (E.g. \"pul\" will match \"Git: Pull\").\n * Otherwise also matches sub string of the word with beginnings of the words in the target (e.g. \"gp\" or \"g p\" will match \"Git: Pull\").\n * Useful in cases where the target is words (e.g. command labels)\n * @internal\n */\nexport function matchesWords(word: string, target: string, contiguous: boolean = false): IMatch[] | null {\n if (!target || target.length === 0) {\n return null;\n }\n\n let result: IMatch[] | null = null;\n let i = 0;\n\n word = word.toLowerCase();\n target = target.toLowerCase();\n while (i < target.length && (result = _matchesWords(word, target, 0, i, contiguous)) === null) {\n i = nextWord(target, i + 1);\n }\n\n return result;\n}\n\nfunction _matchesWords(word: string, target: string, i: number, j: number, contiguous: boolean): IMatch[] | null {\n if (i === word.length) {\n return [];\n } else if (j === target.length) {\n return null;\n } else if (!charactersMatch(word.charCodeAt(i), target.charCodeAt(j))) {\n return null;\n } else {\n let result: IMatch[] | null = null;\n let nextWordIndex = j + 1;\n result = _matchesWords(word, target, i + 1, j + 1, contiguous);\n // istanbul ignore else\n if (!contiguous) {\n while (!result && (nextWordIndex = nextWord(target, nextWordIndex)) < target.length) {\n result = _matchesWords(word, target, i + 1, nextWordIndex, contiguous);\n nextWordIndex++;\n }\n }\n return result === null ? null : join({ start: j, end: j + 1 }, result);\n }\n}\n\nfunction nextWord(word: string, start: number): number {\n for (let i = start; i < word.length; i++) {\n if (isWordSeparator(word.charCodeAt(i)) ||\n (i > 0 && isWordSeparator(word.charCodeAt(i - 1)))) {\n return i;\n }\n }\n return word.length;\n}\n\n// Fuzzy\n\nconst fuzzyContiguousFilter = or(matchesPrefix, matchesCamelCase, matchesContiguousSubString);\nconst fuzzySeparateFilter = or(matchesPrefix, matchesCamelCase, matchesSubString);\nconst fuzzyRegExpCache = new LRUCache<string, RegExp>(10000); // bounded to 10000 elements\n\n/**\n * Match pattern against word in a fuzzy way. This will only return a single match.\n * @internal\n */\nexport function matchesFuzzy(word: string, wordToMatchAgainst: string, enableSeparateSubstringMatching = false): IMatch[] | null {\n // istanbul ignore next\n if (typeof word !== \"string\" || typeof wordToMatchAgainst !== \"string\") {\n return null; // return early for invalid input\n }\n\n // Form RegExp for wildcard matches\n let regexp = fuzzyRegExpCache.get(word);\n if (!regexp) {\n regexp = new RegExp(strings.convertSimple2RegExpPattern(word), \"i\");\n fuzzyRegExpCache.set(word, regexp);\n }\n\n // RegExp Filter\n const match = regexp.exec(wordToMatchAgainst);\n if (match) {\n return [{ start: match.index, end: match.index + match[0].length }];\n }\n\n // Default Filter\n return enableSeparateSubstringMatching ? /* istanbul ignore next */ fuzzySeparateFilter(word, wordToMatchAgainst) : fuzzyContiguousFilter(word, wordToMatchAgainst);\n}\n\n/**\n * Match pattern against word in a fuzzy way. As in IntelliSense and faster and more\n * powerful than `matchesFuzzy`. This will only return a single match.\n * @internal\n */\nexport function matchesFuzzy2(pattern: string, word: string): IMatch[] | null {\n const score = fuzzyScore(pattern, pattern.toLowerCase(), 0, word, word.toLowerCase(), 0, true);\n return score ? createMatches(score) : null;\n}\n\n// #region --- fuzzyScore ---\n/**\n * @internal\n */\nexport function createMatches(score: undefined | FuzzyScore): IMatch[] {\n // istanbul ignore next\n if (typeof score === \"undefined\") {\n return [];\n }\n\n const matches = score[1].toString(2);\n const wordStart = score[2];\n const res: IMatch[] = [];\n\n for (let pos = wordStart; pos < _maxLen; pos++) {\n if (matches[matches.length - (pos + 1)] === \"1\") {\n const last = res[res.length - 1];\n if (last && last.end === pos) {\n last.end = pos + 1;\n } else {\n res.push({ start: pos, end: pos + 1 });\n }\n }\n }\n return res;\n}\n\nconst _maxLen = 128;\n\nfunction initTable() {\n const table: number[][] = [];\n const row: number[] = [0];\n for (let i = 1; i <= _maxLen; i++) {\n row.push(-i);\n }\n for (let i = 0; i <= _maxLen; i++) {\n const thisRow = row.slice(0);\n thisRow[0] = -i;\n table.push(thisRow);\n }\n return table;\n}\n\nconst _table = initTable();\nconst _scores = initTable();\n// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\nconst _arrows = <Arrow[][]>initTable();\nconst _debug = false;\n\nfunction isSeparatorAtPos(value: string, index: number): boolean {\n if (index < 0 || index >= value.length) {\n return false;\n }\n const code = value.charCodeAt(index);\n switch (code) {\n case CharCode.Underline:\n case CharCode.Dash:\n case CharCode.Period:\n case CharCode.Space:\n case CharCode.Slash:\n case CharCode.Backslash:\n case CharCode.SingleQuote:\n case CharCode.DoubleQuote:\n case CharCode.Colon:\n case CharCode.DollarSign:\n return true;\n default:\n return false;\n }\n}\n\nfunction isWhitespaceAtPos(value: string, index: number): boolean {\n if (index < 0 || index >= value.length) {\n return false;\n }\n const code = value.charCodeAt(index);\n switch (code) {\n // istanbul ignore next\n case CharCode.Space:\n case CharCode.Tab:\n return true;\n default:\n return false;\n }\n}\n\nfunction isUpperCaseAtPos(pos: number, word: string, wordLow: string): boolean {\n return word[pos] !== wordLow[pos];\n}\n\n/** @internal */\nexport function isPatternInWord(patternLow: string, patternPos: number, patternLen: number, wordLow: string, wordPos: number, wordLen: number): boolean {\n while (patternPos < patternLen && wordPos < wordLen) {\n if (patternLow[patternPos] === wordLow[wordPos]) {\n patternPos += 1;\n }\n wordPos += 1;\n }\n return patternPos === patternLen; // pattern must be exhausted\n}\n\nconst enum Arrow { Top = 0b1, Diag = 0b10, Left = 0b100 }\n\n/**\n * A tuple of three values.\n * 0. the score\n * 1. the matches encoded as bitmask (2^53)\n * 2. the offset at which matching started\n * @internal\n */\nexport type FuzzyScore = [number, number, number];\n\n/** @internal */\nexport namespace FuzzyScore { // eslint-disable-line @typescript-eslint/no-redeclare\n /**\n * No matches and value `-100`\n * @internal\n */\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n export const Default: [-100, 0, 0] = <[-100, 0, 0]>Object.freeze([-100, 0, 0]);\n\n // istanbul ignore next\n /** @internal */\n export function isDefault(score?: FuzzyScore): score is [-100, 0, 0] {\n return !score || (score[0] === -100 && score[1] === 0 && score[2] === 0);\n }\n}\n\n/** @internal */\nexport type FuzzyScorer = (pattern: string, lowPattern: string, patternPos: number, word: string, lowWord: string, wordPos: number, firstMatchCanBeWeak: boolean) => FuzzyScore | undefined;\n\n/** @internal */\nexport function fuzzyScore(pattern: string, patternLow: string, patternStart: number, word: string, wordLow: string, wordStart: number, firstMatchCanBeWeak: boolean): FuzzyScore | undefined {\n // istanbul ignore next\n const patternLen = pattern.length > _maxLen ? _maxLen : pattern.length;\n const wordLen = word.length > _maxLen ? _maxLen : word.length;\n\n if (patternStart >= patternLen || wordStart >= wordLen || (patternLen - patternStart) > (wordLen - wordStart)) {\n return undefined;\n }\n\n // Run a simple check if the characters of pattern occur\n // (in order) at all in word. If that isn't the case we\n // stop because no match will be possible\n if (!isPatternInWord(patternLow, patternStart, patternLen, wordLow, wordStart, wordLen)) {\n return undefined;\n }\n\n let row: number = 1;\n let column: number = 1;\n let patternPos = patternStart;\n let wordPos = wordStart;\n\n let hasStrongFirstMatch = false;\n\n // There will be a match, fill in tables\n for (row = 1, patternPos = patternStart; patternPos < patternLen; row++, patternPos++) {\n\n for (column = 1, wordPos = wordStart; wordPos < wordLen; column++, wordPos++) {\n\n const score = _doScore(pattern, patternLow, patternPos, patternStart, word, wordLow, wordPos);\n\n if (patternPos === patternStart && score > 1) {\n hasStrongFirstMatch = true;\n }\n\n _scores[row][column] = score;\n\n const diag = _table[row - 1][column - 1] + (score > 1 ? 1 : score);\n const top = _table[row - 1][column] + -1;\n const left = _table[row][column - 1] + -1;\n\n if (left >= top) {\n // left or diag\n if (left > diag) {\n _table[row][column] = left;\n _arrows[row][column] = Arrow.Left;\n } else if (left === diag) {\n _table[row][column] = left;\n _arrows[row][column] = Arrow.Left | Arrow.Diag;\n } else {\n _table[row][column] = diag;\n _arrows[row][column] = Arrow.Diag;\n }\n } else {\n // top or diag\n if (top > diag) {\n _table[row][column] = top;\n _arrows[row][column] = Arrow.Top;\n } else if (top === diag) {\n _table[row][column] = top;\n _arrows[row][column] = Arrow.Top | Arrow.Diag;\n } else {\n _table[row][column] = diag;\n _arrows[row][column] = Arrow.Diag;\n }\n }\n }\n }\n\n if (!hasStrongFirstMatch && !firstMatchCanBeWeak) {\n return undefined;\n }\n\n _matchesCount = 0;\n _topScore = -100;\n _wordStart = wordStart;\n _firstMatchCanBeWeak = firstMatchCanBeWeak;\n\n _findAllMatches2(row - 1, column - 1, patternLen === wordLen ? 1 : 0, 0, false);\n if (_matchesCount === 0) {\n return undefined;\n }\n\n return [_topScore, _topMatch2, wordStart];\n}\n\nfunction _doScore(pattern: string, patternLow: string, patternPos: number, patternStart: number, word: string, wordLow: string, wordPos: number) {\n if (patternLow[patternPos] !== wordLow[wordPos]) {\n return -1;\n }\n if (wordPos === (patternPos - patternStart)) {\n // common prefix: `foobar <-> foobaz`\n // ^^^^^\n if (pattern[patternPos] === word[wordPos]) {\n return 7;\n } else {\n return 5;\n }\n } else if (isUpperCaseAtPos(wordPos, word, wordLow) && (wordPos === 0 || !isUpperCaseAtPos(wordPos - 1, word, wordLow))) {\n // hitting upper-case: `foo <-> forOthers`\n // ^^ ^\n if (pattern[patternPos] === word[wordPos]) {\n return 7;\n } else {\n return 5;\n }\n } else if (isSeparatorAtPos(wordLow, wordPos) && (wordPos === 0 || !isSeparatorAtPos(wordLow, wordPos - 1))) {\n // hitting a separator: `. <-> foo.bar`\n // ^\n return 5;\n\n } else if (isSeparatorAtPos(wordLow, wordPos - 1) || isWhitespaceAtPos(wordLow, wordPos - 1)) {\n // post separator: `foo <-> bar_foo`\n // ^^^\n return 5;\n\n } else {\n return 1;\n }\n}\n\nlet _matchesCount: number = 0;\nlet _topMatch2: number = 0;\nlet _topScore: number = 0;\nlet _wordStart: number = 0;\nlet _firstMatchCanBeWeak: boolean = false;\n\nfunction _findAllMatches2(row: number, column: number, total: number, matches: number, lastMatched: boolean): void {\n\n if (_matchesCount >= 10 || total < -25) {\n // stop when having already 10 results, or\n // when a potential alignment as already 5 gaps\n return;\n }\n\n let simpleMatchCount = 0;\n\n while (row > 0 && column > 0) {\n\n const score = _scores[row][column];\n const arrow = _arrows[row][column];\n\n if (arrow === Arrow.Left) {\n // left -> no match, skip a word character\n column -= 1;\n if (lastMatched) {\n total -= 5; // new gap penalty\n } else if (matches !== 0) {\n total -= 1; // gap penalty after first match\n }\n lastMatched = false;\n simpleMatchCount = 0;\n } else {\n /* istanbul ignore else */\n if (arrow & Arrow.Diag) {\n if (arrow & Arrow.Left) {\n // left\n _findAllMatches2(\n row,\n column - 1,\n matches !== 0 ? total - 1 : total, // gap penalty after first match\n matches,\n lastMatched\n );\n }\n\n // diag\n total += score;\n row -= 1;\n column -= 1;\n lastMatched = true;\n\n // match -> set a 1 at the word pos\n matches += 2 ** (column + _wordStart);\n\n // count simple matches and boost a row of\n // simple matches when they yield in a\n // strong match.\n if (score === 1) {\n simpleMatchCount += 1;\n\n if (row === 0 && !_firstMatchCanBeWeak) {\n // when the first match is a weak\n // match we discard it\n return undefined;\n }\n\n } else {\n // boost\n total += 1 + (simpleMatchCount * (score - 1));\n simpleMatchCount = 0;\n }\n\n } else {\n // istanbul ignore next\n return undefined;\n }\n }\n }\n\n total -= column >= 3 ? 9 : column * 3; // late start penalty\n\n // dynamically keep track of the current top score\n // and insert the current best score at head, the rest at tail\n _matchesCount += 1;\n if (total > _topScore) {\n _topScore = total;\n _topMatch2 = matches;\n }\n}\n\n// #endregion\n\n// #region --- graceful ---\n/** @internal */\nexport function fuzzyScoreGracefulAggressive(pattern: string, lowPattern: string, patternPos: number, word: string, lowWord: string, wordPos: number, firstMatchCanBeWeak: boolean): FuzzyScore | undefined {\n return fuzzyScoreWithPermutations(pattern, lowPattern, patternPos, word, lowWord, wordPos, true, firstMatchCanBeWeak);\n}\n\n/** @internal */\nexport function fuzzyScoreGraceful(pattern: string, lowPattern: string, patternPos: number, word: string, lowWord: string, wordPos: number, firstMatchCanBeWeak: boolean): FuzzyScore | undefined {\n return fuzzyScoreWithPermutations(pattern, lowPattern, patternPos, word, lowWord, wordPos, false, firstMatchCanBeWeak);\n}\n\nfunction fuzzyScoreWithPermutations(pattern: string, lowPattern: string, patternPos: number, word: string, lowWord: string, wordPos: number, aggressive: boolean, firstMatchCanBeWeak: boolean): FuzzyScore | undefined {\n let top = fuzzyScore(pattern, lowPattern, patternPos, word, lowWord, wordPos, firstMatchCanBeWeak);\n\n if (top && !aggressive) {\n // when using the original pattern yield a result we`\n // return it unless we are aggressive and try to find\n // a better alignment, e.g. `cno` -> `^co^ns^ole` or `^c^o^nsole`.\n return top;\n }\n\n // istanbul ignore else\n if (pattern.length >= 3) {\n // When the pattern is long enough then try a few (max 7)\n // permutations of the pattern to find a better match. The\n // permutations only swap neighbouring characters, e.g\n // `cnoso` becomes `conso`, `cnsoo`, `cnoos`.\n const tries = Math.min(7, pattern.length - 1);\n for (let movingPatternPos = patternPos + 1; movingPatternPos < tries; movingPatternPos++) {\n const newPattern = nextTypoPermutation(pattern, movingPatternPos);\n // istanbul ignore else\n if (newPattern) {\n const candidate = fuzzyScore(newPattern, newPattern.toLowerCase(), patternPos, word, lowWord, wordPos, firstMatchCanBeWeak);\n if (candidate) {\n candidate[0] -= 3; // permutation penalty\n // istanbul ignore else\n if (!top || candidate[0] > top[0]) {\n top = candidate;\n }\n }\n }\n }\n }\n\n return top;\n}\n\nfunction nextTypoPermutation(pattern: string, patternPos: number): string | undefined {\n\n // istanbul ignore next\n if (patternPos + 1 >= pattern.length) {\n return undefined;\n }\n\n const swap1 = pattern[patternPos];\n const swap2 = pattern[patternPos + 1];\n\n // istanbul ignore next\n if (swap1 === swap2) {\n return undefined;\n }\n\n return pattern.slice(0, patternPos)\n + swap2\n + swap1\n + pattern.slice(patternPos + 2);\n}\n\n// #endregion\n"]}
|
@@ -33,44 +33,42 @@ class LinkedMap {
|
|
33
33
|
return this._size;
|
34
34
|
}
|
35
35
|
get first() {
|
36
|
-
|
37
|
-
return (_b = this._head) === null || _b === void 0 ? void 0 : _b.value;
|
36
|
+
return this._head?.value;
|
38
37
|
}
|
39
38
|
get last() {
|
40
|
-
|
41
|
-
return (_b = this._tail) === null || _b === void 0 ? void 0 : _b.value;
|
39
|
+
return this._tail?.value;
|
42
40
|
}
|
43
41
|
has(key) {
|
44
42
|
return this._map.has(key);
|
45
43
|
}
|
46
|
-
get(key, touch = 0 /* None */) {
|
44
|
+
get(key, touch = 0 /* Touch.None */) {
|
47
45
|
const item = this._map.get(key);
|
48
46
|
if (!item) {
|
49
47
|
return undefined;
|
50
48
|
}
|
51
|
-
if (touch !== 0 /* None */) {
|
49
|
+
if (touch !== 0 /* Touch.None */) {
|
52
50
|
this.touch(item, touch);
|
53
51
|
}
|
54
52
|
return item.value;
|
55
53
|
}
|
56
|
-
set(key, value, touch = 0 /* None */) {
|
54
|
+
set(key, value, touch = 0 /* Touch.None */) {
|
57
55
|
let item = this._map.get(key);
|
58
56
|
if (item) {
|
59
57
|
item.value = value;
|
60
|
-
if (touch !== 0 /* None */) {
|
58
|
+
if (touch !== 0 /* Touch.None */) {
|
61
59
|
this.touch(item, touch);
|
62
60
|
}
|
63
61
|
}
|
64
62
|
else {
|
65
63
|
item = { key, value, next: undefined, previous: undefined };
|
66
64
|
switch (touch) {
|
67
|
-
case 0 /* None */:
|
65
|
+
case 0 /* Touch.None */:
|
68
66
|
this.addItemLast(item);
|
69
67
|
break;
|
70
|
-
case 1 /* AsOld */:
|
68
|
+
case 1 /* Touch.AsOld */:
|
71
69
|
this.addItemFirst(item);
|
72
70
|
break;
|
73
|
-
case 2 /* AsNew */:
|
71
|
+
case 2 /* Touch.AsNew */:
|
74
72
|
this.addItemLast(item);
|
75
73
|
break;
|
76
74
|
default:
|
@@ -292,10 +290,10 @@ class LinkedMap {
|
|
292
290
|
if (!this._head || !this._tail) {
|
293
291
|
throw new Error("Invalid list");
|
294
292
|
}
|
295
|
-
if ((touch !== 1 /* AsOld */ && touch !== 2 /* AsNew */)) {
|
293
|
+
if ((touch !== 1 /* Touch.AsOld */ && touch !== 2 /* Touch.AsNew */)) {
|
296
294
|
return;
|
297
295
|
}
|
298
|
-
if (touch === 1 /* AsOld */) {
|
296
|
+
if (touch === 1 /* Touch.AsOld */) {
|
299
297
|
if (item === this._head) {
|
300
298
|
return;
|
301
299
|
}
|
@@ -320,7 +318,7 @@ class LinkedMap {
|
|
320
318
|
this._head = item;
|
321
319
|
this._state++;
|
322
320
|
}
|
323
|
-
else if (touch === 2 /* AsNew */) {
|
321
|
+
else if (touch === 2 /* Touch.AsNew */) {
|
324
322
|
if (item === this._tail) {
|
325
323
|
return;
|
326
324
|
}
|
@@ -384,14 +382,14 @@ class LRUCache extends LinkedMap {
|
|
384
382
|
this._ratio = Math.min(Math.max(0, ratio), 1);
|
385
383
|
this.checkTrim();
|
386
384
|
}
|
387
|
-
get(key, touch = 2 /* AsNew */) {
|
385
|
+
get(key, touch = 2 /* Touch.AsNew */) {
|
388
386
|
return super.get(key, touch);
|
389
387
|
}
|
390
388
|
peek(key) {
|
391
|
-
return super.get(key, 0 /* None */);
|
389
|
+
return super.get(key, 0 /* Touch.None */);
|
392
390
|
}
|
393
391
|
set(key, value) {
|
394
|
-
super.set(key, value, 2 /* AsNew */);
|
392
|
+
super.set(key, value, 2 /* Touch.AsNew */);
|
395
393
|
this.checkTrim();
|
396
394
|
return this;
|
397
395
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"map.js","sourceRoot":"","sources":["../../../../../src/appui-abstract/utils/filter/map.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;AAyB/F;;GAEG;AACH,uBAAuB;AACvB,MAAa,SAAS;IAWpB;QATS,QAAoB,GAAG,WAAW,CAAC;QAU1C,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,EAAiB,CAAC;QACrC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAClB,CAAC;IAED,KAAK;QACH,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;QACf,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;IAED,OAAO;QACL,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;IACpC,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC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,qBAA0B;QAC7C,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED,IAAI,CAAC,GAAM;QACT,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,eAAa,CAAC;IACpC,CAAC;IAEQ,GAAG,CAAC,GAAM,EAAE,KAAQ;QAC3B,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,gBAAc,CAAC;QACnC,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,SAAS;QACf,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE;YAC3B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;SACrD;IACH,CAAC;CACF;AAhDD,4BAgDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n// code extracted from https://github.com/microsoft/vscode/blob/master/src/vs/base/common/map.ts\n\n/* eslint-disable @typescript-eslint/explicit-member-accessibility */\n/* eslint-disable @itwin/prefer-get */\n/* eslint-disable no-restricted-syntax */\n/* eslint-disable @typescript-eslint/no-this-alias */\n\ninterface Item<K, V> {\n previous: Item<K, V> | undefined;\n next: Item<K, V> | undefined;\n key: K;\n value: V;\n}\n\n/**\n * @internal\n */\nexport const enum Touch {\n None = 0,\n AsOld = 1,\n AsNew = 2\n}\n\n/**\n * @internal\n */\n// istanbul ignore next\nexport class LinkedMap<K, V> implements Map<K, V> {\n\n readonly [Symbol.toStringTag] = \"LinkedMap\";\n\n private _map: Map<K, Item<K, V>>;\n private _head: Item<K, V> | undefined;\n private _tail: Item<K, V> | undefined;\n private _size: number;\n\n private _state: number;\n\n constructor() {\n this._map = new Map<K, Item<K, V>>();\n this._head = undefined;\n this._tail = undefined;\n this._size = 0;\n this._state = 0;\n }\n\n clear(): void {\n this._map.clear();\n this._head = undefined;\n this._tail = undefined;\n this._size = 0;\n this._state++;\n }\n\n isEmpty(): boolean {\n return !this._head && !this._tail;\n }\n\n get size(): number {\n return this._size;\n }\n\n get first(): V | undefined {\n return this._head?.value;\n }\n\n get last(): V | undefined {\n return this._tail?.value;\n }\n\n has(key: K): boolean {\n return this._map.has(key);\n }\n\n get(key: K, touch: Touch = Touch.None): V | undefined {\n const item = this._map.get(key);\n if (!item) {\n return undefined;\n }\n if (touch !== Touch.None) {\n this.touch(item, touch);\n }\n return item.value;\n }\n\n set(key: K, value: V, touch: Touch = Touch.None): this {\n let item = this._map.get(key);\n if (item) {\n item.value = value;\n if (touch !== Touch.None) {\n this.touch(item, touch);\n }\n } else {\n item = { key, value, next: undefined, previous: undefined };\n switch (touch) {\n case Touch.None:\n this.addItemLast(item);\n break;\n case Touch.AsOld:\n this.addItemFirst(item);\n break;\n case Touch.AsNew:\n this.addItemLast(item);\n break;\n default:\n this.addItemLast(item);\n break;\n }\n this._map.set(key, item);\n this._size++;\n }\n return this;\n }\n\n delete(key: K): boolean {\n return !!this.remove(key);\n }\n\n remove(key: K): V | undefined {\n const item = this._map.get(key);\n if (!item) {\n return undefined;\n }\n this._map.delete(key);\n this.removeItem(item);\n this._size--;\n return item.value;\n }\n\n shift(): V | undefined {\n if (!this._head && !this._tail) {\n return undefined;\n }\n if (!this._head || !this._tail) {\n throw new Error(\"Invalid list\");\n }\n const item = this._head;\n this._map.delete(item.key);\n this.removeItem(item);\n this._size--;\n return item.value;\n }\n\n forEach(callbackfn: (value: V, key: K, map: LinkedMap<K, V>) => void, thisArg?: any): void {\n const state = this._state;\n let current = this._head;\n while (current) {\n if (thisArg) {\n callbackfn.bind(thisArg)(current.value, current.key, this);\n } else {\n callbackfn(current.value, current.key, this);\n }\n if (this._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n current = current.next;\n }\n }\n\n keys(): IterableIterator<K> {\n const map = this;\n const state = this._state;\n let current = this._head;\n const iterator: IterableIterator<K> = {\n [Symbol.iterator]() {\n return iterator;\n },\n next(): IteratorResult<K> {\n if (map._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n if (current) {\n const result = { value: current.key, done: false };\n current = current.next;\n return result;\n } else {\n return { value: undefined, done: true };\n }\n },\n };\n return iterator;\n }\n\n values(): IterableIterator<V> {\n const map = this;\n const state = this._state;\n let current = this._head;\n const iterator: IterableIterator<V> = {\n [Symbol.iterator]() {\n return iterator;\n },\n next(): IteratorResult<V> {\n if (map._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n if (current) {\n const result = { value: current.value, done: false };\n current = current.next;\n return result;\n } else {\n return { value: undefined, done: true };\n }\n },\n };\n return iterator;\n }\n\n entries(): IterableIterator<[K, V]> {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const map = this;\n const state = this._state;\n let current = this._head;\n const iterator: IterableIterator<[K, V]> = {\n [Symbol.iterator]() {\n return iterator;\n },\n next(): IteratorResult<[K, V]> {\n if (map._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n if (current) {\n const result: IteratorResult<[K, V]> = { value: [current.key, current.value], done: false };\n current = current.next;\n return result;\n } else {\n return { value: undefined, done: true };\n }\n },\n };\n return iterator;\n }\n\n [Symbol.iterator](): IterableIterator<[K, V]> {\n return this.entries();\n }\n\n protected trimOld(newSize: number) {\n if (newSize >= this.size) {\n return;\n }\n if (newSize === 0) {\n this.clear();\n return;\n }\n let current = this._head;\n let currentSize = this.size;\n while (current && currentSize > newSize) {\n this._map.delete(current.key);\n current = current.next;\n currentSize--;\n }\n this._head = current;\n this._size = currentSize;\n if (current) {\n current.previous = undefined;\n }\n this._state++;\n }\n\n private addItemFirst(item: Item<K, V>): void {\n // First time Insert\n if (!this._head && !this._tail) {\n this._tail = item;\n } else if (!this._head) {\n throw new Error(\"Invalid list\");\n } else {\n item.next = this._head;\n this._head.previous = item;\n }\n this._head = item;\n this._state++;\n }\n\n private addItemLast(item: Item<K, V>): void {\n // First time Insert\n if (!this._head && !this._tail) {\n this._head = item;\n } else if (!this._tail) {\n throw new Error(\"Invalid list\");\n } else {\n item.previous = this._tail;\n this._tail.next = item;\n }\n this._tail = item;\n this._state++;\n }\n\n private removeItem(item: Item<K, V>): void {\n if (item === this._head && item === this._tail) {\n this._head = undefined;\n this._tail = undefined;\n } else if (item === this._head) {\n // This can only happend if size === 1 which is handle\n // by the case above.\n if (!item.next) {\n throw new Error(\"Invalid list\");\n }\n item.next.previous = undefined;\n this._head = item.next;\n } else if (item === this._tail) {\n // This can only happend if size === 1 which is handle\n // by the case above.\n if (!item.previous) {\n throw new Error(\"Invalid list\");\n }\n item.previous.next = undefined;\n this._tail = item.previous;\n } else {\n const next = item.next;\n const previous = item.previous;\n if (!next || !previous) {\n throw new Error(\"Invalid list\");\n }\n next.previous = previous;\n previous.next = next;\n }\n item.next = undefined;\n item.previous = undefined;\n this._state++;\n }\n\n private touch(item: Item<K, V>, touch: Touch): void {\n if (!this._head || !this._tail) {\n throw new Error(\"Invalid list\");\n }\n if ((touch !== Touch.AsOld && touch !== Touch.AsNew)) {\n return;\n }\n\n if (touch === Touch.AsOld) {\n if (item === this._head) {\n return;\n }\n\n const next = item.next;\n const previous = item.previous;\n\n // Unlink the item\n if (item === this._tail) {\n // previous must be defined since item was not head but is tail\n // So there are more than on item in the map\n previous!.next = undefined;\n this._tail = previous;\n } else {\n // Both next and previous are not undefined since item was neither head nor tail.\n next!.previous = previous;\n previous!.next = next;\n }\n\n // Insert the node at head\n item.previous = undefined;\n item.next = this._head;\n this._head.previous = item;\n this._head = item;\n this._state++;\n } else if (touch === Touch.AsNew) {\n if (item === this._tail) {\n return;\n }\n\n const next = item.next;\n const previous = item.previous;\n\n // Unlink the item.\n if (item === this._head) {\n // next must be defined since item was not tail but is head\n // So there are more than on item in the map\n next!.previous = undefined;\n this._head = next;\n } else {\n // Both next and previous are not undefined since item was neither head nor tail.\n next!.previous = previous;\n previous!.next = next;\n }\n item.next = undefined;\n item.previous = this._tail;\n this._tail.next = item;\n this._tail = item;\n this._state++;\n }\n }\n\n toJSON(): [K, V][] {\n const data: [K, V][] = [];\n\n this.forEach((value, key) => {\n data.push([key, value]);\n });\n\n return data;\n }\n\n fromJSON(data: [K, V][]): void {\n this.clear();\n\n for (const [key, value] of data) {\n this.set(key, value);\n }\n }\n}\n\n/**\n * @internal\n */\n// istanbul ignore next\nexport class LRUCache<K, V> extends LinkedMap<K, V> {\n\n private _limit: number;\n private _ratio: number;\n\n constructor(limit: number, ratio: number = 1) {\n super();\n this._limit = limit;\n this._ratio = Math.min(Math.max(0, ratio), 1);\n }\n\n get limit(): number {\n return this._limit;\n }\n\n set limit(limit: number) {\n this._limit = limit;\n this.checkTrim();\n }\n\n get ratio(): number {\n return this._ratio;\n }\n\n set ratio(ratio: number) {\n this._ratio = Math.min(Math.max(0, ratio), 1);\n this.checkTrim();\n }\n\n override get(key: K, touch: Touch = Touch.AsNew): V | undefined {\n return super.get(key, touch);\n }\n\n peek(key: K): V | undefined {\n return super.get(key, Touch.None);\n }\n\n override set(key: K, value: V): this {\n super.set(key, value, Touch.AsNew);\n this.checkTrim();\n return this;\n }\n\n private checkTrim() {\n if (this.size > this._limit) {\n this.trimOld(Math.round(this._limit * this._ratio));\n }\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"map.js","sourceRoot":"","sources":["../../../../../src/appui-abstract/utils/filter/map.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;AAyB/F;;GAEG;AACH,uBAAuB;AACvB,MAAa,SAAS;IAWpB;QATS,QAAoB,GAAG,WAAW,CAAC;QAU1C,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,EAAiB,CAAC;QACrC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,KAAK,G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AED,IAAI,KAAK,CAAC,KAAa;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAED,IAAI,KAAK,CAAC,KAAa;QACrB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9C,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAEQ,GAAG,CAAC,GAAM,EAAE,2BAA0B;QAC7C,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED,IAAI,CAAC,GAAM;QACT,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,qBAAa,CAAC;IACpC,CAAC;IAEQ,GAAG,CAAC,GAAM,EAAE,KAAQ;QAC3B,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,sBAAc,CAAC;QACnC,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,SAAS;QACf,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE;YAC3B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;SACrD;IACH,CAAC;CACF;AAhDD,4BAgDC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n// code extracted from https://github.com/microsoft/vscode/blob/master/src/vs/base/common/map.ts\n\n/* eslint-disable @typescript-eslint/explicit-member-accessibility */\n/* eslint-disable @itwin/prefer-get */\n/* eslint-disable no-restricted-syntax */\n/* eslint-disable @typescript-eslint/no-this-alias */\n\ninterface Item<K, V> {\n previous: Item<K, V> | undefined;\n next: Item<K, V> | undefined;\n key: K;\n value: V;\n}\n\n/**\n * @internal\n */\nexport const enum Touch {\n None = 0,\n AsOld = 1,\n AsNew = 2\n}\n\n/**\n * @internal\n */\n// istanbul ignore next\nexport class LinkedMap<K, V> implements Map<K, V> {\n\n readonly [Symbol.toStringTag] = \"LinkedMap\";\n\n private _map: Map<K, Item<K, V>>;\n private _head: Item<K, V> | undefined;\n private _tail: Item<K, V> | undefined;\n private _size: number;\n\n private _state: number;\n\n constructor() {\n this._map = new Map<K, Item<K, V>>();\n this._head = undefined;\n this._tail = undefined;\n this._size = 0;\n this._state = 0;\n }\n\n clear(): void {\n this._map.clear();\n this._head = undefined;\n this._tail = undefined;\n this._size = 0;\n this._state++;\n }\n\n isEmpty(): boolean {\n return !this._head && !this._tail;\n }\n\n get size(): number {\n return this._size;\n }\n\n get first(): V | undefined {\n return this._head?.value;\n }\n\n get last(): V | undefined {\n return this._tail?.value;\n }\n\n has(key: K): boolean {\n return this._map.has(key);\n }\n\n get(key: K, touch: Touch = Touch.None): V | undefined {\n const item = this._map.get(key);\n if (!item) {\n return undefined;\n }\n if (touch !== Touch.None) {\n this.touch(item, touch);\n }\n return item.value;\n }\n\n set(key: K, value: V, touch: Touch = Touch.None): this {\n let item = this._map.get(key);\n if (item) {\n item.value = value;\n if (touch !== Touch.None) {\n this.touch(item, touch);\n }\n } else {\n item = { key, value, next: undefined, previous: undefined };\n switch (touch) {\n case Touch.None:\n this.addItemLast(item);\n break;\n case Touch.AsOld:\n this.addItemFirst(item);\n break;\n case Touch.AsNew:\n this.addItemLast(item);\n break;\n default:\n this.addItemLast(item);\n break;\n }\n this._map.set(key, item);\n this._size++;\n }\n return this;\n }\n\n delete(key: K): boolean {\n return !!this.remove(key);\n }\n\n remove(key: K): V | undefined {\n const item = this._map.get(key);\n if (!item) {\n return undefined;\n }\n this._map.delete(key);\n this.removeItem(item);\n this._size--;\n return item.value;\n }\n\n shift(): V | undefined {\n if (!this._head && !this._tail) {\n return undefined;\n }\n if (!this._head || !this._tail) {\n throw new Error(\"Invalid list\");\n }\n const item = this._head;\n this._map.delete(item.key);\n this.removeItem(item);\n this._size--;\n return item.value;\n }\n\n forEach(callbackfn: (value: V, key: K, map: LinkedMap<K, V>) => void, thisArg?: any): void {\n const state = this._state;\n let current = this._head;\n while (current) {\n if (thisArg) {\n callbackfn.bind(thisArg)(current.value, current.key, this);\n } else {\n callbackfn(current.value, current.key, this);\n }\n if (this._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n current = current.next;\n }\n }\n\n keys(): IterableIterator<K> {\n const map = this;\n const state = this._state;\n let current = this._head;\n const iterator: IterableIterator<K> = {\n [Symbol.iterator]() {\n return iterator;\n },\n next(): IteratorResult<K> {\n if (map._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n if (current) {\n const result = { value: current.key, done: false };\n current = current.next;\n return result;\n } else {\n return { value: undefined, done: true };\n }\n },\n };\n return iterator;\n }\n\n values(): IterableIterator<V> {\n const map = this;\n const state = this._state;\n let current = this._head;\n const iterator: IterableIterator<V> = {\n [Symbol.iterator]() {\n return iterator;\n },\n next(): IteratorResult<V> {\n if (map._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n if (current) {\n const result = { value: current.value, done: false };\n current = current.next;\n return result;\n } else {\n return { value: undefined, done: true };\n }\n },\n };\n return iterator;\n }\n\n entries(): IterableIterator<[K, V]> {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const map = this;\n const state = this._state;\n let current = this._head;\n const iterator: IterableIterator<[K, V]> = {\n [Symbol.iterator]() {\n return iterator;\n },\n next(): IteratorResult<[K, V]> {\n if (map._state !== state) {\n throw new Error(`LinkedMap got modified during iteration.`);\n }\n if (current) {\n const result: IteratorResult<[K, V]> = { value: [current.key, current.value], done: false };\n current = current.next;\n return result;\n } else {\n return { value: undefined, done: true };\n }\n },\n };\n return iterator;\n }\n\n [Symbol.iterator](): IterableIterator<[K, V]> {\n return this.entries();\n }\n\n protected trimOld(newSize: number) {\n if (newSize >= this.size) {\n return;\n }\n if (newSize === 0) {\n this.clear();\n return;\n }\n let current = this._head;\n let currentSize = this.size;\n while (current && currentSize > newSize) {\n this._map.delete(current.key);\n current = current.next;\n currentSize--;\n }\n this._head = current;\n this._size = currentSize;\n if (current) {\n current.previous = undefined;\n }\n this._state++;\n }\n\n private addItemFirst(item: Item<K, V>): void {\n // First time Insert\n if (!this._head && !this._tail) {\n this._tail = item;\n } else if (!this._head) {\n throw new Error(\"Invalid list\");\n } else {\n item.next = this._head;\n this._head.previous = item;\n }\n this._head = item;\n this._state++;\n }\n\n private addItemLast(item: Item<K, V>): void {\n // First time Insert\n if (!this._head && !this._tail) {\n this._head = item;\n } else if (!this._tail) {\n throw new Error(\"Invalid list\");\n } else {\n item.previous = this._tail;\n this._tail.next = item;\n }\n this._tail = item;\n this._state++;\n }\n\n private removeItem(item: Item<K, V>): void {\n if (item === this._head && item === this._tail) {\n this._head = undefined;\n this._tail = undefined;\n } else if (item === this._head) {\n // This can only happend if size === 1 which is handle\n // by the case above.\n if (!item.next) {\n throw new Error(\"Invalid list\");\n }\n item.next.previous = undefined;\n this._head = item.next;\n } else if (item === this._tail) {\n // This can only happend if size === 1 which is handle\n // by the case above.\n if (!item.previous) {\n throw new Error(\"Invalid list\");\n }\n item.previous.next = undefined;\n this._tail = item.previous;\n } else {\n const next = item.next;\n const previous = item.previous;\n if (!next || !previous) {\n throw new Error(\"Invalid list\");\n }\n next.previous = previous;\n previous.next = next;\n }\n item.next = undefined;\n item.previous = undefined;\n this._state++;\n }\n\n private touch(item: Item<K, V>, touch: Touch): void {\n if (!this._head || !this._tail) {\n throw new Error(\"Invalid list\");\n }\n if ((touch !== Touch.AsOld && touch !== Touch.AsNew)) {\n return;\n }\n\n if (touch === Touch.AsOld) {\n if (item === this._head) {\n return;\n }\n\n const next = item.next;\n const previous = item.previous;\n\n // Unlink the item\n if (item === this._tail) {\n // previous must be defined since item was not head but is tail\n // So there are more than on item in the map\n previous!.next = undefined;\n this._tail = previous;\n } else {\n // Both next and previous are not undefined since item was neither head nor tail.\n next!.previous = previous;\n previous!.next = next;\n }\n\n // Insert the node at head\n item.previous = undefined;\n item.next = this._head;\n this._head.previous = item;\n this._head = item;\n this._state++;\n } else if (touch === Touch.AsNew) {\n if (item === this._tail) {\n return;\n }\n\n const next = item.next;\n const previous = item.previous;\n\n // Unlink the item.\n if (item === this._head) {\n // next must be defined since item was not tail but is head\n // So there are more than on item in the map\n next!.previous = undefined;\n this._head = next;\n } else {\n // Both next and previous are not undefined since item was neither head nor tail.\n next!.previous = previous;\n previous!.next = next;\n }\n item.next = undefined;\n item.previous = this._tail;\n this._tail.next = item;\n this._tail = item;\n this._state++;\n }\n }\n\n toJSON(): [K, V][] {\n const data: [K, V][] = [];\n\n this.forEach((value, key) => {\n data.push([key, value]);\n });\n\n return data;\n }\n\n fromJSON(data: [K, V][]): void {\n this.clear();\n\n for (const [key, value] of data) {\n this.set(key, value);\n }\n }\n}\n\n/**\n * @internal\n */\n// istanbul ignore next\nexport class LRUCache<K, V> extends LinkedMap<K, V> {\n\n private _limit: number;\n private _ratio: number;\n\n constructor(limit: number, ratio: number = 1) {\n super();\n this._limit = limit;\n this._ratio = Math.min(Math.max(0, ratio), 1);\n }\n\n get limit(): number {\n return this._limit;\n }\n\n set limit(limit: number) {\n this._limit = limit;\n this.checkTrim();\n }\n\n get ratio(): number {\n return this._ratio;\n }\n\n set ratio(ratio: number) {\n this._ratio = Math.min(Math.max(0, ratio), 1);\n this.checkTrim();\n }\n\n override get(key: K, touch: Touch = Touch.AsNew): V | undefined {\n return super.get(key, touch);\n }\n\n peek(key: K): V | undefined {\n return super.get(key, Touch.None);\n }\n\n override set(key: K, value: V): this {\n super.set(key, value, Touch.AsNew);\n this.checkTrim();\n return this;\n }\n\n private checkTrim() {\n if (this.size > this._limit) {\n this.trimOld(Math.round(this._limit * this._ratio));\n }\n }\n}\n"]}
|
@@ -16,14 +16,14 @@ exports.convertSimple2RegExpPattern = convertSimple2RegExpPattern;
|
|
16
16
|
* @internal
|
17
17
|
*/
|
18
18
|
function isLowerAsciiLetter(code) {
|
19
|
-
return code >= 97 /* a */ && code <= 122 /* z */;
|
19
|
+
return code >= 97 /* CharCode.a */ && code <= 122 /* CharCode.z */;
|
20
20
|
}
|
21
21
|
exports.isLowerAsciiLetter = isLowerAsciiLetter;
|
22
22
|
/**
|
23
23
|
* @internal
|
24
24
|
*/
|
25
25
|
function isUpperAsciiLetter(code) {
|
26
|
-
return code >= 65 /* A */ && code <= 90 /* Z */;
|
26
|
+
return code >= 65 /* CharCode.A */ && code <= 90 /* CharCode.Z */;
|
27
27
|
}
|
28
28
|
exports.isUpperAsciiLetter = isUpperAsciiLetter;
|
29
29
|
/**
|