mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 15:05:39 +01:00
Add folding rules
This commit is contained in:
parent
46247f86ca
commit
21ac5f13ec
17 changed files with 115 additions and 15 deletions
|
|
@ -27,7 +27,13 @@ export const conf: IRichLanguageConfiguration = {
|
|||
{ open: '[', close: ']' },
|
||||
{ open: '(', close: ')' },
|
||||
{ open: '"', close: '"' },
|
||||
]
|
||||
],
|
||||
folding: {
|
||||
markers: {
|
||||
start: new RegExp("^\\s*(::\\s*|REM\\s+)#region"),
|
||||
end: new RegExp("^\\s*(::\\s*|REM\\s+)#endregion")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const language = <ILanguage>{
|
||||
|
|
|
|||
|
|
@ -32,7 +32,13 @@ export const conf: IRichLanguageConfiguration = {
|
|||
{ open: '(', close: ')' },
|
||||
{ open: '"', close: '"' },
|
||||
{ open: '\'', close: '\'' },
|
||||
]
|
||||
],
|
||||
folding: {
|
||||
markers: {
|
||||
start: new RegExp("^\\s*#region\\b"),
|
||||
end: new RegExp("^\\s*#endregion\\b")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const language = <ILanguage>{
|
||||
|
|
|
|||
|
|
@ -31,7 +31,13 @@ export const conf: IRichLanguageConfiguration = {
|
|||
{ open: '(', close: ')' },
|
||||
{ open: '"', close: '"' },
|
||||
{ open: '\'', close: '\'' },
|
||||
]
|
||||
],
|
||||
folding: {
|
||||
markers: {
|
||||
start: new RegExp("^\\s*#pragma\\s+region\\b"),
|
||||
end: new RegExp("^\\s*#pragma\\s+endregion\\b")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const language = <ILanguage>{
|
||||
|
|
|
|||
|
|
@ -33,7 +33,13 @@ export const conf: IRichLanguageConfiguration = {
|
|||
{ open: '<', close: '>' },
|
||||
{ open: '\'', close: '\'' },
|
||||
{ open: '"', close: '"' },
|
||||
]
|
||||
],
|
||||
folding: {
|
||||
markers: {
|
||||
start: new RegExp("^\\s*#region\\b"),
|
||||
end: new RegExp("^\\s*#endregion\\b")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const language = <ILanguage>{
|
||||
|
|
|
|||
|
|
@ -35,7 +35,14 @@ export const conf: LanguageConfiguration = {
|
|||
{ open: '(', close: ')' },
|
||||
{ open: '"', close: '"' },
|
||||
{ open: '\'', close: '\'' }
|
||||
]
|
||||
],
|
||||
|
||||
folding: {
|
||||
markers: {
|
||||
start: new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),
|
||||
end: new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const language = <IMonarchLanguage>{
|
||||
|
|
|
|||
|
|
@ -30,7 +30,13 @@ export const conf: IRichLanguageConfiguration = {
|
|||
{ open: '(', close: ')' },
|
||||
{ open: '"', close: '"' },
|
||||
{ open: '\'', close: '\'' }
|
||||
]
|
||||
],
|
||||
folding: {
|
||||
markers: {
|
||||
start: new RegExp("^\\s*//\\s*#region\\b|^\\s*\\(\\*\\s*#region(.*)\\*\\)"),
|
||||
end: new RegExp("^\\s*//\\s*#endregion\\b|^\\s*\\(\\*\\s*#endregion\\s*\\*\\)")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const language = <ILanguage>{
|
||||
|
|
|
|||
|
|
@ -55,6 +55,13 @@ export const conf: IRichLanguageConfiguration = {
|
|||
action: { indentAction: _monaco.languages.IndentAction.Indent }
|
||||
}
|
||||
],
|
||||
|
||||
folding: {
|
||||
markers: {
|
||||
start: new RegExp("^\\s*<!--\\s*#region\\b.*-->"),
|
||||
end: new RegExp("^\\s*<!--\\s*#endregion\\b.*-->")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const language = <ILanguage>{
|
||||
|
|
|
|||
|
|
@ -34,7 +34,13 @@ export const conf: IRichLanguageConfiguration = {
|
|||
{ open: '"', close: '"' },
|
||||
{ open: '\'', close: '\'' },
|
||||
{ open: '<', close: '>' },
|
||||
]
|
||||
],
|
||||
folding: {
|
||||
markers: {
|
||||
start: new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),
|
||||
end: new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const language = <ILanguage>{
|
||||
|
|
|
|||
|
|
@ -32,7 +32,13 @@ export const conf: IRichLanguageConfiguration = {
|
|||
{ open: '(', close: ')' },
|
||||
{ open: '"', close: '"' },
|
||||
{ open: '\'', close: '\'' },
|
||||
]
|
||||
],
|
||||
folding: {
|
||||
markers: {
|
||||
start: new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),
|
||||
end: new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const language = <ILanguage>{
|
||||
|
|
|
|||
|
|
@ -44,7 +44,13 @@ export const conf: IRichLanguageConfiguration = {
|
|||
{ open: '(', close: ')' },
|
||||
{ open: '[', close: ']' },
|
||||
{ open: '`', close: '`' },
|
||||
]
|
||||
],
|
||||
folding: {
|
||||
markers: {
|
||||
start: new RegExp("^\\s*<!--\\s*#?region\\b.*-->"),
|
||||
end: new RegExp("^\\s*<!--\\s*#?endregion\\b.*-->")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const language = <ILanguage>{
|
||||
|
|
|
|||
|
|
@ -28,7 +28,14 @@ export const conf: IRichLanguageConfiguration = {
|
|||
{ open: '(', close: ')', notIn: ['string'] },
|
||||
{ open: '"', close: '"', notIn: ['string'] },
|
||||
{ open: '\'', close: '\'', notIn: ['string', 'comment'] }
|
||||
]
|
||||
],
|
||||
|
||||
folding: {
|
||||
markers: {
|
||||
start: new RegExp("^\\s*(#|\/\/)region\\b"),
|
||||
end: new RegExp("^\\s*(#|\/\/)endregion\\b")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const language = <ILanguage>{
|
||||
|
|
|
|||
|
|
@ -33,7 +33,13 @@ export const conf: IRichLanguageConfiguration = {
|
|||
{ open: '(', close: ')' },
|
||||
{ open: '"', close: '"' },
|
||||
{ open: '\'', close: '\'' },
|
||||
]
|
||||
],
|
||||
folding: {
|
||||
markers: {
|
||||
start: new RegExp("^\\s*#region\\b"),
|
||||
end: new RegExp("^\\s*#endregion\\b")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const language = <ILanguage>{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,10 @@ export const conf: IRichLanguageConfiguration = {
|
|||
{ open: '{', close: '}', notIn: ['string', 'comment'] },
|
||||
{ open: '[', close: ']', notIn: ['string', 'comment'] },
|
||||
{ open: '(', close: ')', notIn: ['string', 'comment'] },
|
||||
]
|
||||
],
|
||||
folding: {
|
||||
offSide: true
|
||||
}
|
||||
};
|
||||
|
||||
export const language = <ILanguage>{
|
||||
|
|
|
|||
|
|
@ -31,7 +31,14 @@ export const conf: IRichLanguageConfiguration = {
|
|||
{ open: '(', close: ')' },
|
||||
{ open: '"', close: '"' },
|
||||
{ open: '\'', close: '\'' },
|
||||
]
|
||||
],
|
||||
folding: {
|
||||
offSide: true,
|
||||
markers: {
|
||||
start: new RegExp("^\\s*#region\\b"),
|
||||
end: new RegExp("^\\s*#endregion\\b")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const language = <ILanguage>{
|
||||
|
|
|
|||
|
|
@ -32,7 +32,13 @@ export const conf: LanguageConfiguration = {
|
|||
{ open: '(', close: ')' },
|
||||
{ open: '"', close: '"' },
|
||||
{ open: '\'', close: '\'' },
|
||||
]
|
||||
],
|
||||
folding: {
|
||||
markers: {
|
||||
start: new RegExp("^\\s*\\/\\*\\s*#region\\b\\s*(.*?)\\s*\\*\\/"),
|
||||
end: new RegExp("^\\s*\\/\\*\\s*#endregion\\b.*\\*\\/")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const language = <IMonarchLanguage>{
|
||||
|
|
|
|||
|
|
@ -47,7 +47,13 @@ export const conf: IRichLanguageConfiguration = {
|
|||
{ open: '(', close: ')', notIn: ['string', 'comment'] },
|
||||
{ open: '"', close: '"', notIn: ['string', 'comment'] },
|
||||
{ open: '<', close: '>', notIn: ['string', 'comment'] },
|
||||
]
|
||||
],
|
||||
folding: {
|
||||
markers: {
|
||||
start: new RegExp("^\\s*#Region\\b"),
|
||||
end: new RegExp("^\\s*#End Region\\b")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export const language = <ILanguage>{
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@ export const conf: IRichLanguageConfiguration = {
|
|||
{ open: '"', close: '"' },
|
||||
{ open: '\'', close: '\'' },
|
||||
],
|
||||
folding: {
|
||||
offSide: true
|
||||
}
|
||||
};
|
||||
|
||||
export const language = <ILanguage>{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue