Skip to content

Commit 37950ff

Browse files
authored
Merge pull request #12930 from microsoft/seanmcm/1_22_11_release
Cherry-pick and version and changelog update for 1.22.11
2 parents dead10a + 23b0672 commit 37950ff

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

Extension/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# C/C++ for Visual Studio Code Changelog
22

3+
## Version 1.22.11: November 5, 2024
4+
### Bug Fixes
5+
* Fix system includes incorrectly being treated as non-system includes when specified with `-I`. [#12842](https://github.com/microsoft/vscode-cpptools/issues/12842)
6+
* Fix inactive region ranges when multi-byte UTF-8 characters are used. [#12879](https://github.com/microsoft/vscode-cpptools/issues/12879)
7+
* Fix formatting with `.editorconfig` files. [#12921](https://github.com/microsoft/vscode-cpptools/issues/12921)
8+
39
## Version 1.22.10: October 21, 2024
410
### Bug Fixes
511
* Fix the 'Extract to Function' feature not working.

Extension/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "cpptools",
33
"displayName": "C/C++",
44
"description": "C/C++ IntelliSense, debugging, and code browsing.",
5-
"version": "1.22.9-main",
5+
"version": "1.22.11-main",
66
"publisher": "ms-vscode",
77
"icon": "LanguageCCPP_color_128x.png",
88
"readme": "README.md",

Extension/src/LanguageServer/editorConfig.ts

+13-3
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,17 @@ function parseEditorConfigContent(content: string): Record<string, any> {
9292
const [key, ...values] = line.split('=');
9393
if (key && values.length > 0) {
9494
const trimmedKey = key.trim();
95-
const value = values.join('=').trim();
95+
let value: any = values.join('=').trim();
96+
97+
// Convert boolean-like and numeric values.
98+
if (value.toLowerCase() === 'true') {
99+
value = true;
100+
} else if (value.toLowerCase() === 'false') {
101+
value = false;
102+
} else if (!isNaN(Number(value))) {
103+
value = Number(value);
104+
}
105+
96106
if (currentSection) {
97107
// Ensure the current section is initialized.
98108
if (!config[currentSection]) {
@@ -114,7 +124,7 @@ function getEditorConfig(filePath: string): any {
114124
const rootDir: string = path.parse(currentDir).root;
115125

116126
// Traverse from the file's directory to the root directory.
117-
for (;;) {
127+
for (; ;) {
118128
const editorConfigPath: string = path.join(currentDir, '.editorconfig');
119129
if (fs.existsSync(editorConfigPath)) {
120130
const configFileContent: string = fs.readFileSync(editorConfigPath, 'utf-8');
@@ -139,7 +149,7 @@ function getEditorConfig(filePath: string): any {
139149
});
140150

141151
// Check if the current .editorconfig is the root.
142-
if (configData['*']?.root?.toLowerCase() === 'true') {
152+
if (configData['*']?.root) {
143153
break; // Stop searching after processing the root = true file.
144154
}
145155
}

0 commit comments

Comments
 (0)