diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index d8a2f36bba..9e13fd1eac 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -1,5 +1,11 @@ # C/C++ for Visual Studio Code Changelog +## Version 1.22.11: November 5, 2024 +### Bug Fixes +* Fix system includes incorrectly being treated as non-system includes when specified with `-I`. [#12842](https://github.com/microsoft/vscode-cpptools/issues/12842) +* Fix inactive region ranges when multi-byte UTF-8 characters are used. [#12879](https://github.com/microsoft/vscode-cpptools/issues/12879) +* Fix formatting with `.editorconfig` files. [#12921](https://github.com/microsoft/vscode-cpptools/issues/12921) + ## Version 1.22.10: October 21, 2024 ### Bug Fixes * Fix the 'Extract to Function' feature not working. diff --git a/Extension/package.json b/Extension/package.json index 8674cf9db1..e6643aa695 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -2,7 +2,7 @@ "name": "cpptools", "displayName": "C/C++", "description": "C/C++ IntelliSense, debugging, and code browsing.", - "version": "1.22.9-main", + "version": "1.22.11-main", "publisher": "ms-vscode", "icon": "LanguageCCPP_color_128x.png", "readme": "README.md", diff --git a/Extension/src/LanguageServer/editorConfig.ts b/Extension/src/LanguageServer/editorConfig.ts index 1ac8452b46..21a73673c6 100644 --- a/Extension/src/LanguageServer/editorConfig.ts +++ b/Extension/src/LanguageServer/editorConfig.ts @@ -92,7 +92,17 @@ function parseEditorConfigContent(content: string): Record { const [key, ...values] = line.split('='); if (key && values.length > 0) { const trimmedKey = key.trim(); - const value = values.join('=').trim(); + let value: any = values.join('=').trim(); + + // Convert boolean-like and numeric values. + if (value.toLowerCase() === 'true') { + value = true; + } else if (value.toLowerCase() === 'false') { + value = false; + } else if (!isNaN(Number(value))) { + value = Number(value); + } + if (currentSection) { // Ensure the current section is initialized. if (!config[currentSection]) { @@ -114,7 +124,7 @@ function getEditorConfig(filePath: string): any { const rootDir: string = path.parse(currentDir).root; // Traverse from the file's directory to the root directory. - for (;;) { + for (; ;) { const editorConfigPath: string = path.join(currentDir, '.editorconfig'); if (fs.existsSync(editorConfigPath)) { const configFileContent: string = fs.readFileSync(editorConfigPath, 'utf-8'); @@ -139,7 +149,7 @@ function getEditorConfig(filePath: string): any { }); // Check if the current .editorconfig is the root. - if (configData['*']?.root?.toLowerCase() === 'true') { + if (configData['*']?.root) { break; // Stop searching after processing the root = true file. } }