未验证 提交 8eae60df 编写于 作者: A Alexandru Dima 提交者: GitHub

Merge pull request #135197 from thebinarysearchtree/Tagged-templates

Remove backticks from word character fix
......@@ -598,7 +598,7 @@ export class TypeOperations {
}
// Do not auto-close ' or " after a word character
if (autoClosingPair.open.length === 1 && chIsQuote && autoCloseConfig !== 'always') {
if (autoClosingPair.open.length === 1 && (ch === '\'' || ch === '"') && autoCloseConfig !== 'always') {
const wordSeparators = getMapForWordSeparators(config.wordSeparators);
if (insertOpenCharacter && position.column > 1 && wordSeparators.get(lineText.charCodeAt(position.column - 2)) === WordCharacterClass.Regular) {
return null;
......
......@@ -4878,6 +4878,18 @@ suite('autoClosingPairs', () => {
model.undo();
}
test('issue #61070: backtick (`) should auto-close after a word character', () => {
let mode = new AutoClosingMode();
usingCursor({
text: ['const markup = highlight'],
languageId: mode.languageId
}, (editor, model, viewModel) => {
model.forceTokenization(1);
assertType(editor, model, viewModel, 1, 25, '`', '``', `auto closes \` @ (1, 25)`);
});
mode.dispose();
});
test('open parens: default', () => {
let mode = new AutoClosingMode();
usingCursor({
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册