1
>
/*---------------------------------------------------------------------------------------------
random.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import { numberComparator } from '../../../../base/common/arrays.js';
7
>
import { BugIndicatingError } from '../../../../base/common/errors.js';
8
>
import { StringEdit, StringReplacement } from '../../../common/core/edits/stringEdit.js';
9
>
import { OffsetRange } from '../../../common/core/ranges/offsetRange.js';
10
>
import { Position } from '../../../common/core/position.js';
11
>
import { PositionOffsetTransformer } from '../../../common/core/text/positionToOffset.js';
12
>
import { Range } from '../../../common/core/range.js';
13
>
import { TextReplacement, TextEdit } from '../../../common/core/edits/textEdit.js';
14
>
import { AbstractText } from '../../../common/core/text/abstractText.js';
15
>
16
>
export abstract class Random {
17
>
public static readonly alphabetSmallLowercase = 'abcdefgh';
18
>
public static readonly alphabetSmallUppercase = 'ABCDEFGH';
19
>
public static readonly alphabetLowercase = 'abcdefghijklmnopqrstuvwxyz';
20
>
public static readonly alphabetUppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
21
>
public static readonly basicAlphabet: string = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
22
>
public static readonly basicAlphabetMultiline: string = ' \n\n\nabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
23
>
24
>
public static create(seed: number): Random {
25
return new MersenneTwister(seed);
26
}
28
>
public stringGenerator(alphabet: string): IGenerator<string> {
29
return {
30
next: () => {