mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
AutoIndent: Enrich TypeScript and HTML rules.
This commit is contained in:
parent
d036417745
commit
19ae0932c4
|
@ -78,6 +78,10 @@ export function activate(context: ExtensionContext) {
|
|||
});
|
||||
|
||||
languages.setLanguageConfiguration('html', {
|
||||
indentationRules: {
|
||||
increaseIndentPattern: /<(?!\?|(?:area|base|br|col|frame|hr|html|img|input|link|meta|param)\b|[^>]*\/>)([-_\.A-Za-z0-9]+)(?=\s|>)\b[^>]*>(?!.*<\/\1>)|<!--(?!.*-->)|\{[^}"']*$/,
|
||||
decreaseIndentPattern: /^\s*(<\/(?!html)[-_\.A-Za-z0-9]+\b[^>]*>|-->|\})/
|
||||
},
|
||||
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,
|
||||
onEnterRules: [
|
||||
{
|
||||
|
|
|
@ -283,9 +283,10 @@ class LanguageProvider {
|
|||
this.disposables.push(languages.setLanguageConfiguration(modeId, {
|
||||
indentationRules: {
|
||||
// ^(.*\*/)?\s*\}.*$
|
||||
decreaseIndentPattern: /^(.*\*\/)?\s*\}.*$/,
|
||||
decreaseIndentPattern: /^(.*\*\/)?\s*[\}|\]|\)].*$/,
|
||||
// ^.*\{[^}"']*$
|
||||
increaseIndentPattern: /^.*\{[^}"'`]*$/
|
||||
increaseIndentPattern: /^.*(\{[^}"'`]*|\([^)"'`]*|\[[^\]"'`]*)$/,
|
||||
indentNextLinePattern: /^\s*(for|while|if|else)\b(?!.*[;{}]\s*(\/\/.*|\/[*].*[*]\/\s*)?$)/
|
||||
},
|
||||
wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,
|
||||
onEnterRules: [
|
||||
|
|
Loading…
Reference in a new issue