Skip to content

Commit 21abcb0

Browse files
authored
Merge pull request #229 from aeschli/patch-1
Move away from deprecated language configuration settings
2 parents b8a06ab + 3e8a89d commit 21abcb0

File tree

1 file changed

+28
-13
lines changed

1 file changed

+28
-13
lines changed

src/main.ts

+28-13
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,34 @@ export function activate(context: vscode.ExtensionContext): void {
5050
['(', ')'],
5151
],
5252

53-
__electricCharacterSupport: {
54-
docComment: { scope: 'comment.documentation', open: '/**', lineStart: ' * ', close: ' */' }
55-
},
56-
57-
__characterPairSupport: {
58-
autoClosingPairs: [
59-
{ open: '{', close: '}' },
60-
{ open: '[', close: ']' },
61-
{ open: '(', close: ')' },
62-
{ open: '"', close: '"', notIn: ['string'] },
63-
{ open: '\'', close: '\'', notIn: ['string', 'comment'] }
64-
]
65-
}
53+
onEnterRules: [
54+
{
55+
// e.g. /** | */
56+
beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,
57+
afterText: /^\s*\*\/$/,
58+
action: { indentAction: IndentAction.IndentOutdent, appendText: ' * ' }
59+
},
60+
{
61+
// e.g. /** ...|
62+
beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,
63+
action: { indentAction: IndentAction.None, appendText: ' * ' }
64+
},
65+
{
66+
// e.g. * ...|
67+
beforeText: /^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,
68+
action: { indentAction: IndentAction.None, appendText: '* ' }
69+
},
70+
{
71+
// e.g. */|
72+
beforeText: /^(\t|(\ \ ))*\ \*\/\s*$/,
73+
action: { indentAction: IndentAction.None, removeText: 1 }
74+
},
75+
{
76+
// e.g. *-----*/|
77+
beforeText: /^(\t|(\ \ ))*\ \*[^/]*\*\/\s*$/,
78+
action: { indentAction: IndentAction.None, removeText: 1 }
79+
}
80+
]
6681
});
6782

6883
// Create the logger

0 commit comments

Comments
 (0)