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

Create a fixer for misplaced preprocessor directives #11164

Open
333fred opened this issue Nov 5, 2024 · 0 comments
Open

Create a fixer for misplaced preprocessor directives #11164

333fred opened this issue Nov 5, 2024 · 0 comments
Labels
enhancement Small improvement request

Comments

@333fred
Copy link
Member

333fred commented Nov 5, 2024

As part of the new tokenizer, we require that preprocessor directives are at the start of the line (modulo whitespace). The razor compiler will emit a couple of diagnostics for scenarios where it sees violations, or potential violations, of this rule, and it would be good to have IDE fixers to help users clean this up. These diagnostics are:

  • Error RZ1043: C# preprocessor directives must be at the start of the line, except for whitespace.
    • This error is given when we know for certain that a preprocessor directive is misplaced.
  • Warning RZ1044: Possible C# preprocessor directive is misplaced. C# preprocessor directives must be at the start of the line, except for whitespace.
    • This warning is given when there's a disabled preprocessor section and a possible #else, #elif, or #endif was found in that disabled text.

/cc @ryzngard

@phil-allen-msft phil-allen-msft added the enhancement Small improvement request label Nov 12, 2024
@phil-allen-msft phil-allen-msft added this to the 17.13 Planning milestone Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Small improvement request
Projects
None yet
Development

No branches or pull requests

2 participants