Skip to content

Commit 397f4e5

Browse files
authored
Normalize JSON trailing newlines. (#14579)
* Unify json newlines.
1 parent 0f754f7 commit 397f4e5

706 files changed

Lines changed: 717 additions & 705 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Extension/.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"editor.defaultFormatter": "vscode.json-language-features",
2929
"editor.tabSize": 4,
3030
"editor.detectIndentation": true,
31-
"files.insertFinalNewline": false
31+
"files.insertFinalNewline": true
3232
},
3333
"[jsonc]": {
3434
"editor.formatOnSave": true,

Extension/.yarn-bootstrap/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Extension/.yarn-bootstrap/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
"devDependencies": {
88
"yarn": "1.22.22"
99
}
10-
}
10+
}

Extension/bin/messages/de/messages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3748,4 +3748,4 @@
37483748
"%nd wurde zuvor ohne explizite Enumerationsbasis deklariert",
37493749
"Fehlender „typename“ entspricht hier nicht dem Standard.",
37503750
"Die abgekürzte Funktionsvorlagensyntax entspricht nicht dem Standard für Deduktionsleitfäden."
3751-
]
3751+
]

Extension/bin/messages/es/messages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3748,4 +3748,4 @@
37483748
"%nd se declaró previamente sin una base explícita de enumeración",
37493749
"falta 'typename' no estándar aquí",
37503750
"La sintaxis abreviada de las plantillas de funciones no es estándar para las guías de deducción"
3751-
]
3751+
]

Extension/c_cpp_properties.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,4 +300,4 @@
300300
"version"
301301
],
302302
"additionalProperties": false
303-
}
303+
}

Extension/gulpfile.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,18 @@ gulp.task("translations-import", (done) => {
270270
let id = language.transifexId || language.id;
271271
return gulp.src(path.join(options.location, id, translationProjectName, `${translationExtensionName}.xlf`))
272272
.pipe(nls.prepareJsonFiles())
273+
.pipe(es.map((file, cb) => {
274+
// vscode-nls-dev emits .i18n.json files without a trailing newline. Append one so the
275+
// checked-in files match the repo convention (files.insertFinalNewline for [json]) and
276+
// don't produce churn the next time they're opened and saved in VS Code.
277+
if (file.isBuffer()) {
278+
const contents = file.contents;
279+
if (contents.length > 0 && contents[contents.length - 1] !== 0x0A) {
280+
file.contents = Buffer.concat([contents, Buffer.from("\n")]);
281+
}
282+
}
283+
cb(null, file);
284+
}))
273285
.pipe(gulp.dest(path.join("./i18n", language.folderName)))
274286
.pipe(es.wait()); // This is required or it gives `this.pipeTo.end is not a function`.
275287
}))

Extension/i18n/chs/Reinstalling the Extension.md.i18n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
"reinstall.extension.text7": "然后通过 VS Code 中的市场 UI 重新安装。",
1919
"reinstall.extension.text8": "如果 VS Code 无法部署扩展的正确版本,则可以 {0} 并使用 VS Code 中市场 UI 内 \"...\" 菜单下的 \"从 VSIX... 安装\" 选项安装系统的正确 VSIX。",
2020
"download.vsix.link.title": "已从 VS Code 市场网站下载"
21-
}
21+
}

Extension/i18n/chs/c_cpp_properties.schema.json.i18n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
"c_cpp_properties.schema.json.definitions.env": "可以使用 `${变量}` 或 `${env:变量}` 语法在此文件中的任何位置重复使用的自定义变量。",
2929
"c_cpp_properties.schema.json.definitions.version": "配置文件的版本。此属性由扩展托管。请勿更改它。",
3030
"c_cpp_properties.schema.json.definitions.enableConfigurationSquiggles": "控制扩展是否将报告在 `c_cpp_properties.json` 中检测到的错误。"
31-
}
31+
}

Extension/i18n/chs/package.i18n.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,4 +460,4 @@
460460
"c_cpp.configuration.refactoring.includeHeader.never.description": "从不包含头文件。",
461461
"c_cpp.languageModelTools.configuration.displayName": "C/C++ 配置",
462462
"c_cpp.languageModelTools.configuration.userDescription": "活动 C 或 C++ 文件的配置,例如语言标准版本和目标平台。"
463-
}
463+
}

0 commit comments

Comments
 (0)