diff --git a/extensions/json/src/jsonMain.ts b/extensions/json/src/jsonMain.ts index bd3c55b74f73e8c970f520d0efd44f97e2aea0d6..329f99531ebd50481d38d6fcf19d319723b51807 100644 --- a/extensions/json/src/jsonMain.ts +++ b/extensions/json/src/jsonMain.ts @@ -75,7 +75,17 @@ export function activate(context: ExtensionContext) { context.subscriptions.push(disposable); languages.setLanguageConfiguration('json', { - wordPattern: /(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g + wordPattern: /(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g, + __characterPairSupport: { + autoClosingPairs: [ + { open: '{', close: '}' }, + { open: '[', close: ']' }, + { open: '(', close: ')' }, + { open: '"', close: '"', notIn: ['string'] }, + { open: '\'', close: '\'', notIn: ['string', 'comment'] }, + { open: '`', close: '`', notIn: ['string', 'comment'] } + ] + } }); }