Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macro ifdef incorrectly parsed #12879

Closed
raholly opened this issue Oct 23, 2024 · 3 comments
Closed

Macro ifdef incorrectly parsed #12879

raholly opened this issue Oct 23, 2024 · 3 comments
Assignees
Labels
bug Feature: Colorization fixed Check the Milestone for the release in which the fix is or will be available. Language Service regression A bug that didn't exist in a previous release world ready An issue relating string character encodings, localization translations, etc.
Milestone

Comments

@raholly
Copy link

raholly commented Oct 23, 2024

Environment

  • OS and Version: Windows 11 23H2
  • VS Code Version: v1.94.2
  • C/C++ Extension Version: v1.22.10
  • If using SSH remote, specify OS of remote machine: CentOS 7.9

Bug Summary and Steps to Reproduce

Bug Summary:
I found that when Chinese characters appear in the middle of an ifdef macro, the code parsing will be incorrect.
The below screenshots show the issue. A very strange problem.
The first image is correct, while the parsing in the second and third images is incorrect.

Image

Image

Image

By the way, I tested version 1.21.6 of the C/C++ extension and didn't encounter this issue.

Configuration and Logs

Here is c_cpp_properties.json

{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/local/bin/clang",
"intelliSenseMode": "linux-clang-x64"
}
],
"version": 4
}

Other Extensions

No response

Additional context

No response

@sean-mcmanus sean-mcmanus added bug Language Service world ready An issue relating string character encodings, localization translations, etc. Feature: Colorization labels Oct 23, 2024
@sean-mcmanus sean-mcmanus added the regression A bug that didn't exist in a previous release label Oct 23, 2024
@sean-mcmanus
Copy link
Contributor

@raholly Thanks for reporting this. A minimal repro is

#if 0
//测试e
#else
#endif

Image

@sean-mcmanus sean-mcmanus added this to the 1.23 milestone Oct 23, 2024
@sean-mcmanus sean-mcmanus moved this to Todo in cpptools Oct 23, 2024
@sean-mcmanus sean-mcmanus modified the milestones: 1.23, 1.23.0 Oct 24, 2024
@sean-mcmanus sean-mcmanus moved this from In progress to Pull Request in cpptools Oct 24, 2024
@sean-mcmanus sean-mcmanus moved this from Pull Request to Done in cpptools Oct 28, 2024
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Oct 28, 2024
@sean-mcmanus
Copy link
Contributor

@sean-mcmanus
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Feature: Colorization fixed Check the Milestone for the release in which the fix is or will be available. Language Service regression A bug that didn't exist in a previous release world ready An issue relating string character encodings, localization translations, etc.
Projects
Status: Done
Development

No branches or pull requests

3 participants