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

CSE0003 Multiline comments are truncated #36

Open
NimeshDhruve opened this issue Oct 14, 2015 · 2 comments
Open

CSE0003 Multiline comments are truncated #36

NimeshDhruve opened this issue Oct 14, 2015 · 2 comments
Labels

Comments

@NimeshDhruve
Copy link

When a single line return is followed by multiple line comments refactoring removes all but first line.

example

The same doesn't happen if the comments are inside /*.......*/ block.

anotherexample

@DustinCampbell
Copy link
Owner

Could you provide the actual code that fails? I'm having trouble getting that second example from just the preview (since it's truncated 😄).

@NimeshDhruve
Copy link
Author

Sure thing, just to be clear it doesn't fail but removes comments.

Original Code

class RefactoringDemo
{
    public int MyProperty { get; set; }
    public override string ToString()
    {
        return $"MyProperty: {MyProperty}"; //  This is demo for multi line comments
                                            //1) This is line 1
                                            //2) This is line 2         
    }


    public string AnotherExample()
    {
        return $"MyProperty: {MyProperty}"; /*  This is demo for multi line comments
                                            //1) This is line 1
                                            //2) This is line 2     
                                            */
    }
}

Refactored code (have a look at comment inside ToString() method)

class RefactoringDemo
{
    public int MyProperty { get; set; }
    public override string ToString() => $"MyProperty: {MyProperty}"; //    This is demo for multi line comments


    public string AnotherExample() => $"MyProperty: {MyProperty}"; /*   This is demo for multi line comments
                                            //1) This is line 1
                                            //2) This is line 2     
                                            */
}

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

No branches or pull requests

2 participants