import { LanguageConfigurationRegistry, TextDocument, Position, IndentAction } from 'typescript vs.editor.common.modes.languageconfigurationregistry'; const registry = new LanguageConfigurationRegistry(); registry.register('typescript', { brackets: [ ['{', '}'], ['[', ']'], ['(', ')'], ], indentationRules: { increaseIndentPattern: /^.*(function|class|interface).*\{[^}]*$/, decreaseIndentPattern: /^\s*\}/ }, onEnterRules: [ { beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, afterText: /^\s*\*\/$/, action: { indentAction: IndentAction.None, appendText: ' * ' } } ] });
import { LanguageConfigurationRegistry, TextDocument, Position, IndentAction } from 'typescript vs.editor.common.modes.languageconfigurationregistry'; const registry = new LanguageConfigurationRegistry(); registry.register('markdown', { brackets: [ ['(', ')'], ['[', ']'], ['{', '}'], ], indentationRules: { increaseIndentPattern: /^(\s*((#+)|(>\s))?([^<>\{\}\[\]]+:\s.*|\S.*))$/, decreaseIndentPattern: /^\s*((\*|-|\+|\d+\.)\s.*)$/ }, onEnterRules: [ { beforeText: /^\s*((\*|-|\+|\d+\.)\s+.*)$/, afterText: /^$/, action: { indentAction: IndentAction.Indent, appendText: '* ' } } ] });In this example, we are registering a language configuration for Markdown that includes rules for brackets, indentation and onEnter actions. The indentationRules and onEnterRules are different from the TypeScript example and are specific to Markdown. The typescript vs.editor.common.modes.languageconfigurationregistry package library provides a LanguageConfigurationRegistry class to register language configurations for various programming languages.