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

Code fix for SA1119 doesn't work well for preprocessor directives. #2069

Closed
mpawelski opened this issue Feb 1, 2016 · 1 comment
Closed
Assignees
Milestone

Comments

@mpawelski
Copy link

This code:

    public class Program
    {
        public static void Main(string[] args)
        {
#if(DEBUG)

#endif

        }
    }

got SA1119 warning but after applying a fix this is the new code:

    public class Program
    {
        public static void Main(string[] args)
        {
#ifDEBUG

#endif

        }
    }

wchich gives a compiler error. It should be #if DEBUG not #ifDEBUG

@pdelvo
Copy link
Member

pdelvo commented Feb 1, 2016

Hi @mpawelski,

Thanks for reporting this bug!

I took a quick look at it and it looks like the ElasticMarker is not working correctly in this case. The formatter is supposed to insert a space if necessary (This might be a bug in roslyn). We probably want to redirect this bug report and implement special handling for this case to work around it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants