Skip to content

Commit 3e8a89d

Browse files
authored
Move away from deprecated language configuration settings
1 parent 5d25d5f commit 3e8a89d

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
@@ -57,19 +57,34 @@ export function activate(context: vscode.ExtensionContext): void {
5757
['(', ')'],
5858
],
5959

60-
__electricCharacterSupport: {
61-
docComment: { scope: 'comment.documentation', open: '/**', lineStart: ' * ', close: ' */' }
62-
},
63-
64-
__characterPairSupport: {
65-
autoClosingPairs: [
66-
{ open: '{', close: '}' },
67-
{ open: '[', close: ']' },
68-
{ open: '(', close: ')' },
69-
{ open: '"', close: '"', notIn: ['string'] },
70-
{ open: '\'', close: '\'', notIn: ['string', 'comment'] }
71-
]
72-
}
60+
onEnterRules: [
61+
{
62+
// e.g. /** | */
63+
beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,
64+
afterText: /^\s*\*\/$/,
65+
action: { indentAction: IndentAction.IndentOutdent, appendText: ' * ' }
66+
},
67+
{
68+
// e.g. /** ...|
69+
beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/,
70+
action: { indentAction: IndentAction.None, appendText: ' * ' }
71+
},
72+
{
73+
// e.g. * ...|
74+
beforeText: /^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/,
75+
action: { indentAction: IndentAction.None, appendText: '* ' }
76+
},
77+
{
78+
// e.g. */|
79+
beforeText: /^(\t|(\ \ ))*\ \*\/\s*$/,
80+
action: { indentAction: IndentAction.None, removeText: 1 }
81+
},
82+
{
83+
// e.g. *-----*/|
84+
beforeText: /^(\t|(\ \ ))*\ \*[^/]*\*\/\s*$/,
85+
action: { indentAction: IndentAction.None, removeText: 1 }
86+
}
87+
]
7388
});
7489

7590
// The language server is only available on Windows

0 commit comments

Comments
 (0)