提交 a678f601 编写于 作者: M Martin Aeschlimann

FoldingRules language configuration simplification

上级 3c511821
......@@ -20,8 +20,6 @@
["\"", "\""]
],
"folding": {
"indendationBasedFolding": {
"offSide": true
}
"offSide": true
}
}
\ No newline at end of file
......@@ -23,8 +23,6 @@
["'", "'"]
],
"folding": {
"indendationBasedFolding": {
"offSide": true
}
"offSide": true
}
}
\ No newline at end of file
......@@ -22,8 +22,6 @@
["'", "'"]
],
"folding": {
"indendationBasedFolding": {
"offSide": true
}
"offSide": true
}
}
......@@ -39,8 +39,6 @@
["`", "`"]
],
"folding": {
"indendationBasedFolding": {
"offSide": true
}
"offSide": true
}
}
\ No newline at end of file
......@@ -22,8 +22,6 @@
["\"", "\""]
],
"folding": {
"indendationBasedFolding": {
"offSide": true
}
"offSide": true
}
}
\ No newline at end of file
......@@ -23,8 +23,6 @@
["'", "'"]
],
"folding": {
"indendationBasedFolding": {
"offSide": true
}
"offSide": true
}
}
\ No newline at end of file
......@@ -22,8 +22,6 @@
["'", "'"]
],
"folding": {
"indendationBasedFolding": {
"offSide": true
}
"offSide": true
}
}
\ No newline at end of file
......@@ -844,8 +844,7 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke
private _getIndentRanges(): IndentRange[] {
if (!this._indentRanges) {
let foldingRules = LanguageConfigurationRegistry.getFoldingRules(this._languageIdentifier.id);
let offSide = foldingRules && foldingRules.indendationBasedFolding && foldingRules.indendationBasedFolding.offSide;
this._indentRanges = computeRanges(this, offSide);
let offSide = foldingRules && foldingRules.offSide;
}
return this._indentRanges;
}
......
......@@ -102,18 +102,15 @@ export interface IndentationRule {
* Describes folding rules for a language.
*/
export interface FoldingRules {
indendationBasedFolding?: {
/**
* Used by the indentation based strategy to decide wheter empty lines belong to the previous or the next block.
* A language adheres to the off-side rule if blocks in that language are expressed by their indentation.
* See [wikipedia](https://en.wikipedia.org/wiki/Off-side_rule) for more information.
* If not set, `false` is used and empty lines belong to the previous block.
*/
offSide: boolean;
};
/**
* Used by the indentation based strategy to decide wheter empty lines belong to the previous or the next block.
* A language adheres to the off-side rule if blocks in that language are expressed by their indentation.
* See [wikipedia](https://en.wikipedia.org/wiki/Off-side_rule) for more information.
* If not set, `false` is used and empty lines belong to the previous block.
*/
offSide?: boolean;
}
/**
* Describes a rule to be evaluated when pressing Enter.
*/
......
......@@ -4365,15 +4365,13 @@ declare module monaco.languages {
* Describes folding rules for a language.
*/
export interface FoldingRules {
indendationBasedFolding?: {
/**
* Used by the indentation based strategy to decide wheter empty lines belong to the previous or the next block.
* A language adheres to the off-side rule if blocks in that language are expressed by their indentation.
* See [wikipedia](https://en.wikipedia.org/wiki/Off-side_rule) for more information.
* If not set, `false` is used and empty lines belong to the previous block.
*/
offSide: boolean;
};
/**
* Used by the indentation based strategy to decide wheter empty lines belong to the previous or the next block.
* A language adheres to the off-side rule if blocks in that language are expressed by their indentation.
* See [wikipedia](https://en.wikipedia.org/wiki/Off-side_rule) for more information.
* If not set, `false` is used and empty lines belong to the previous block.
*/
offSide?: boolean;
}
/**
......
......@@ -387,15 +387,9 @@ const schema: IJSONSchema = {
type: 'object',
description: nls.localize('schema.folding', 'The language\'s folding settings.'),
properties: {
indendationBasedFolding: {
type: 'object',
description: nls.localize('schema.folding.indendationBasedFolding', 'Settings for indentation based folding.'),
properties: {
offSide: {
type: 'boolean',
description: nls.localize('schema.folding.indendationBasedFolding.offSide', 'A language adheres to the off-side rule if blocks in that language are expressed by their indentation. If set, empty lines belong to the subsequent block.'),
}
}
offSide: {
type: 'boolean',
description: nls.localize('schema.folding.offSide', 'A language adheres to the off-side rule if blocks in that language are expressed by their indentation. If set, empty lines belong to the subsequent block.'),
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册