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

♯if0 comment out in C language does not work well #161180

Closed
welch-s opened this issue Sep 17, 2022 · 2 comments
Closed

♯if0 comment out in C language does not work well #161180

welch-s opened this issue Sep 17, 2022 · 2 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) triage-needed

Comments

@welch-s
Copy link

welch-s commented Sep 17, 2022

Does this issue occur when all extensions are disabled?: Yes
Have not installed any extensions. I just installed VScode.

  • OS and version: Windows10
  • VS Code: 1.71.0

Bug Summary and Steps to Reproduce

Bug Summary:

If you put a comment in an area that is disabled by the preprocessor, the process of darkening the source code works incorrectly.

Steps to reproduce:

Try the following in your .c file.

No problem description

Areas that were invalidated by the preprocessor are darkened as intended.

#if 0
static int test;
#endif

void main(void)
{
char a;
a++;
}
image


Description that does not work well

If you insert a half-width space or a tab and a slash x2 in the invalidation area, the blackout specification will be applied to the code after the endif.

#if 0 //
static int test; //
#endif

void main(void)
{
char a;
a++;
}

image

@RedCMD
Copy link
Contributor

RedCMD commented Sep 17, 2022

#157626

@rzhao271 rzhao271 added the *duplicate Issue identified as a duplicate of another issue(s) label Sep 19, 2022
@rzhao271 rzhao271 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2022
@jeff-hykin
Copy link

Sorry to keep shuffling the issue around but this should be its final resting place:
jeff-hykin/better-c-syntax#4

As a temp fix you can highlight C code using C++ highlighting

@github-actions github-actions bot locked and limited conversation to collaborators Nov 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) triage-needed
Projects
None yet
Development

No branches or pull requests

5 participants