1
>
/*---------------------------------------------------------------------------------------------
electricCharacter.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 { distinct } from '../../../../base/common/arrays.js';
7
>
import { ScopedLineTokens, ignoreBracketsInToken } from '../supports.js';
8
>
import { BracketsUtils, RichEditBrackets } from './richEditBrackets.js';
9
>
10
>
/**
11
>
* Interface used to support electric characters
12
>
* @internal
13
>
*/
14
>
export interface IElectricAction {
15
>
// The line will be indented at the same level of the line
16
>
// which contains the matching given bracket type.
17
>
matchOpenBracket: string;
18
>
}
19
>
20
>
export class BracketElectricCharacterSupport {
21
>
22
>
private readonly _richEditBrackets: RichEditBrackets | null;
23
>
24
>
constructor(richEditBrackets: RichEditBrackets | null) {
25
this._richEditBrackets = richEditBrackets;
26
}
28
>
public getElectricCharacters(): string[] {
29
const result: string[] = [];
30