Skip to content

VB -> C#: withBlock semicolon not in right line #436

Closed

Description

@Saibamen

Input code

With Some(intB)  'SomeComment
    .Packlist = True
End With

Erroneous output

{
    var withBlock = Some[intB]  // SomeComment
;
    withBlock.Packlist = true;
}

Expected output

{
    var withBlock = Some[intB];  // SomeComment
    withBlock.Packlist = true;
}

Details

  • Product in use: e.g. web converter
  • Version in use: 7.2.0.0
  • Did you see it working in a previous version, which? Don't know
  • Any other relevant information to the issue, or your interest in contributing a fix.

Activity

  1. changed the title [-]withBlock semicolon not in right line[/-] [+]VB -> C#: withBlock semicolon not in right line[/+] on Nov 22, 2019
  2. added
    VB -> C#
    on Nov 23, 2019
  3. GrahamTheCoder commented on Nov 23, 2019

    @GrahamTheCoder
    Member

    Thanks for reporting this. This type of issue (semicolon in wrong place) can happen in quite a few places, usually where it's placed on a block structure like this.
    To fix just this case we could special case VisitWithBlock in https://github.com/icsharpcode/CodeConverter/blob/master/ICSharpCode.CodeConverter/CSharp/CommentConvertingMethodBodyVisitor.cs
    To fix the more general case, we might add a specific check for the semicolon symbol after trivia, and always move any trivia forwards one, which might be possible to add here:
    https://github.com/icsharpcode/CodeConverter/blob/master/ICSharpCode.CodeConverter/Shared/TriviaConverter.cs#L133

  4. GrahamTheCoder commented on Nov 23, 2019

    @GrahamTheCoder
    Member

    Consolidating #437 into this for organizational purposed, use it as a test case for the general fix. Obviously in that case it's a colon rather than a semicolon.

  5. GrahamTheCoder commented on Mar 7, 2020

    @GrahamTheCoder
    Member

    The fix for this and #437 are both now released

  6. Saibamen commented on Mar 8, 2020

    @Saibamen
    ContributorAuthor

    Which commit/PR?

  7. GrahamTheCoder commented on Mar 8, 2020

    @GrahamTheCoder
    Member

    In #518 I entirely switched out the trivia conversion for the one I developed in #512 and #517. There is definitely still plenty of room to improve, but now we have a solid foundation to build on at least.

  8. Saibamen commented on Mar 8, 2020

    @Saibamen
    ContributorAuthor

    Ok. Thank you.
    Please add those information (linked issues and PRs) to help other people contribute to your project

  9. GrahamTheCoder commented on Mar 8, 2020

    @GrahamTheCoder
    Member

    It's generally my intention to do so whenever it'd take me under a minute of searching to find the right links. In this case I was just getting a little lazy assuming no one would care once it's released, but now I know someone does care, I will up my efforts.
    Obviously I'll still miss things so feel free to continue to ask.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    VB -> C#enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions