Skip to content

Commit 61c22d7

Browse files
authored
EditorConfig Support (#5932)
1 parent f82c1ed commit 61c22d7

File tree

5 files changed

+327
-18
lines changed

5 files changed

+327
-18
lines changed

Extension/package.json

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,24 @@
133133
"description": "%c_cpp.configuration.vcFormat.indent.multiLineRelativeTo.description%",
134134
"scope": "resource"
135135
},
136-
"C_Cpp.vcFormat.indent.preserveIndentationWithinParentheses": {
136+
"C_Cpp.vcFormat.indent.withinParentheses": {
137+
"type": "string",
138+
"enum": [
139+
"alignToParenthesis",
140+
"indent"
141+
],
142+
"enumDescriptions": [
143+
"%c_cpp.configuration.vcFormat.indent.withinParentheses.alignToParenthesis.description%",
144+
"%c_cpp.configuration.vcFormat.indent.withinParentheses.indent.description%"
145+
],
146+
"default": "indent",
147+
"description": "%c_cpp.configuration.vcFormat.indent.withinParentheses.description%",
148+
"scope": "resource"
149+
},
150+
"C_Cpp.vcFormat.indent.preserveWithinParentheses": {
137151
"type": "boolean",
138152
"default": false,
139-
"description": "%c_cpp.configuration.vcFormat.indent.preserveIndentationWithinParentheses.description%",
153+
"description": "%c_cpp.configuration.vcFormat.indent.preserveWithinParentheses.description%",
140154
"scope": "resource"
141155
},
142156
"C_Cpp.vcFormat.indent.caseLabels": {
@@ -300,13 +314,13 @@
300314
},
301315
"C_Cpp.vcFormat.newLine.closeBraceSameLine.emptyType": {
302316
"type": "boolean",
303-
"default": true,
317+
"default": false,
304318
"description": "%c_cpp.configuration.vcFormat.newLine.closeBraceSameLine.emptyType.description%",
305319
"scope": "resource"
306320
},
307321
"C_Cpp.vcFormat.newLine.closeBraceSameLine.emptyFunction": {
308322
"type": "boolean",
309-
"default": true,
323+
"default": false,
310324
"description": "%c_cpp.configuration.vcFormat.newLine.closeBraceSameLine.emptyFunction.description%",
311325
"scope": "resource"
312326
},
@@ -2219,6 +2233,7 @@
22192233
"@typescript-eslint/parser": "^2.19.2",
22202234
"async-child-process": "^1.1.1",
22212235
"await-notify": "^1.0.1",
2236+
"editorconfig": "^0.15.3",
22222237
"escape-string-regexp": "^2.0.0",
22232238
"eslint": "^6.8.0",
22242239
"eslint-plugin-import": "^2.20.1",

Extension/package.nls.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@
2323
"c_cpp.configuration.formatting.Default.description": "clang-format will be used to format code",
2424
"c_cpp.configuration.formatting.Disabled.description": "Code formatting will be disabled",
2525
"c_cpp.configuration.vcFormat.indent.braces.description": "Braces are indented by the amount specified in the Editor: Tab Size setting",
26-
"c_cpp.configuration.vcFormat.indent.multiLineRelativeTo.description": "When a new line is typed, indent the new line relatively to:",
26+
"c_cpp.configuration.vcFormat.indent.multiLineRelativeTo.description": "Indent new lines relatively to:",
2727
"c_cpp.configuration.vcFormat.indent.multiLineRelativeTo.outermostParenthesis.description": "the outermost open parenthesis",
2828
"c_cpp.configuration.vcFormat.indent.multiLineRelativeTo.innermostParenthesis.description": "the innermost open parenthesis",
2929
"c_cpp.configuration.vcFormat.indent.multiLineRelativeTo.statementBegin.description": "the beginning of the current statement",
30-
"c_cpp.configuration.vcFormat.indent.preserveIndentationWithinParentheses.description": "When a new line is typed, it is aligned under the opening parenthesis or it is indented by the amount specified in the Editor: Tab Size setting",
30+
"c_cpp.configuration.vcFormat.indent.withinParentheses.description": "When a new line is typed, it is aligned under the opening parenthesis or based on `C_Cpp.vcFormat.indent.multiLineRelativeTo`",
31+
"c_cpp.configuration.vcFormat.indent.withinParentheses.alignToParenthesis.description": "New line is aligned under the opening parenthesis",
32+
"c_cpp.configuration.vcFormat.indent.withinParentheses.indent.description": "New line is indented based on `C_Cpp.vcFormat.indent.multiLineRelativeTo`",
33+
"c_cpp.configuration.vcFormat.indent.preserveWithinParentheses.description": "In existing code, preserve the existing indent alignment of new lines within parentheses",
3134
"c_cpp.configuration.vcFormat.indent.caseLabels.description": "Labels are indented relative to switch statements by the amount specified in the Editor: Tab Size setting",
3235
"c_cpp.configuration.vcFormat.indent.caseContents.description": "Code inside case is indented relative to its label by the amount specified in the Editor: Tab Size setting",
3336
"c_cpp.configuration.vcFormat.indent.caseContentsWhenBlock.description": "Indent braces following a case statement by the amount specified in the Editor: Tab Size setting",

0 commit comments

Comments
 (0)