Skip to content

Commit

Permalink
Merge pull request #12930 from microsoft/seanmcm/1_22_11_release
Browse files Browse the repository at this point in the history
Cherry-pick and version and changelog update for 1.22.11
  • Loading branch information
sean-mcmanus authored Nov 5, 2024
2 parents dead10a + 23b0672 commit 37950ff
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 13 additions & 3 deletions Extension/src/LanguageServer/editorConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,17 @@ function parseEditorConfigContent(content: string): Record<string, any> {
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]) {
Expand All @@ -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');
Expand All @@ -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.
}
}
Expand Down

0 comments on commit 37950ff

Please sign in to comment.