1
>
/*---------------------------------------------------------------------------------------------
characterPair.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 { IAutoClosingPair, StandardAutoClosingPairConditional, LanguageConfiguration } from '../languageConfiguration.js';
7
>
8
>
export class CharacterPairSupport {
9
>
10
>
static readonly DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES = ';:.,=}])> \n\t';
11
>
static readonly DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS = '\'"`;:.,=}])> \n\t';
12
>
static readonly DEFAULT_AUTOCLOSE_BEFORE_WHITESPACE = ' \n\t';
13
>
14
>
private readonly _autoClosingPairs: StandardAutoClosingPairConditional[];
15
>
private readonly _surroundingPairs: IAutoClosingPair[];
16
>
private readonly _autoCloseBeforeForQuotes: string;
17
>
private readonly _autoCloseBeforeForBrackets: string;
18
>
19
>
constructor(config: LanguageConfiguration) {
20
if (config.autoClosingPairs) {
21
this._autoClosingPairs = config.autoClosingPairs.map(el => new StandardAutoClosingPairConditional(el));