Skip to content

Commit a678f60

Browse files
committed
FoldingRules language configuration simplification
1 parent 3c51182 commit a678f60

11 files changed

Lines changed: 25 additions & 51 deletions

File tree

extensions/clojure/language-configuration.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
["\"", "\""]
2121
],
2222
"folding": {
23-
"indendationBasedFolding": {
24-
"offSide": true
25-
}
23+
"offSide": true
2624
}
2725
}

extensions/coffeescript/language-configuration.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
["'", "'"]
2424
],
2525
"folding": {
26-
"indendationBasedFolding": {
27-
"offSide": true
28-
}
26+
"offSide": true
2927
}
3028
}

extensions/fsharp/language-configuration.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
["'", "'"]
2323
],
2424
"folding": {
25-
"indendationBasedFolding": {
26-
"offSide": true
27-
}
25+
"offSide": true
2826
}
2927
}

extensions/markdown/language-configuration.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
["`", "`"]
4040
],
4141
"folding": {
42-
"indendationBasedFolding": {
43-
"offSide": true
44-
}
42+
"offSide": true
4543
}
4644
}

extensions/pug/language-configuration.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
["\"", "\""]
2323
],
2424
"folding": {
25-
"indendationBasedFolding": {
26-
"offSide": true
27-
}
25+
"offSide": true
2826
}
2927
}

extensions/python/language-configuration.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
["'", "'"]
2424
],
2525
"folding": {
26-
"indendationBasedFolding": {
27-
"offSide": true
28-
}
26+
"offSide": true
2927
}
3028
}

extensions/yaml/language-configuration.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
["'", "'"]
2323
],
2424
"folding": {
25-
"indendationBasedFolding": {
26-
"offSide": true
27-
}
25+
"offSide": true
2826
}
2927
}

src/vs/editor/common/model/textModelWithTokens.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,8 +844,7 @@ export class TextModelWithTokens extends TextModel implements editorCommon.IToke
844844
private _getIndentRanges(): IndentRange[] {
845845
if (!this._indentRanges) {
846846
let foldingRules = LanguageConfigurationRegistry.getFoldingRules(this._languageIdentifier.id);
847-
let offSide = foldingRules && foldingRules.indendationBasedFolding && foldingRules.indendationBasedFolding.offSide;
848-
this._indentRanges = computeRanges(this, offSide);
847+
let offSide = foldingRules && foldingRules.offSide;
849848
}
850849
return this._indentRanges;
851850
}

src/vs/editor/common/modes/languageConfiguration.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,15 @@ export interface IndentationRule {
102102
* Describes folding rules for a language.
103103
*/
104104
export interface FoldingRules {
105-
indendationBasedFolding?: {
106-
/**
107-
* Used by the indentation based strategy to decide wheter empty lines belong to the previous or the next block.
108-
* A language adheres to the off-side rule if blocks in that language are expressed by their indentation.
109-
* See [wikipedia](https://en.wikipedia.org/wiki/Off-side_rule) for more information.
110-
* If not set, `false` is used and empty lines belong to the previous block.
111-
*/
112-
offSide: boolean;
113-
};
105+
/**
106+
* Used by the indentation based strategy to decide wheter empty lines belong to the previous or the next block.
107+
* A language adheres to the off-side rule if blocks in that language are expressed by their indentation.
108+
* See [wikipedia](https://en.wikipedia.org/wiki/Off-side_rule) for more information.
109+
* If not set, `false` is used and empty lines belong to the previous block.
110+
*/
111+
offSide?: boolean;
114112
}
115113

116-
117114
/**
118115
* Describes a rule to be evaluated when pressing Enter.
119116
*/

src/vs/monaco.d.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4365,15 +4365,13 @@ declare module monaco.languages {
43654365
* Describes folding rules for a language.
43664366
*/
43674367
export interface FoldingRules {
4368-
indendationBasedFolding?: {
4369-
/**
4370-
* Used by the indentation based strategy to decide wheter empty lines belong to the previous or the next block.
4371-
* A language adheres to the off-side rule if blocks in that language are expressed by their indentation.
4372-
* See [wikipedia](https://en.wikipedia.org/wiki/Off-side_rule) for more information.
4373-
* If not set, `false` is used and empty lines belong to the previous block.
4374-
*/
4375-
offSide: boolean;
4376-
};
4368+
/**
4369+
* Used by the indentation based strategy to decide wheter empty lines belong to the previous or the next block.
4370+
* A language adheres to the off-side rule if blocks in that language are expressed by their indentation.
4371+
* See [wikipedia](https://en.wikipedia.org/wiki/Off-side_rule) for more information.
4372+
* If not set, `false` is used and empty lines belong to the previous block.
4373+
*/
4374+
offSide?: boolean;
43774375
}
43784376

43794377
/**

0 commit comments

Comments
 (0)