The Online Converter messes up object initializers #514

Open
opened 2016-02-09 14:32:14 -06:00 by beppe9000 · 11 comments
beppe9000 commented 2016-02-09 14:32:14 -06:00 (Migrated from github.com)

When converting C# to Vb.Net using the Online Converter i found two issues, #513 is the first, and this is the second.

Code with object initializers like this

StudentName student2 = new StudentName
        {
            FirstName = "Craig",
            LastName = "Playstead",
        };

is wrongly translated to this (notice the "Key " parts)

Dim student2 As New StudentName() With { _
    Key .FirstName = "Craig", _
    Key .LastName = "Playstead" _
}

instead of this

Dim student2 As New StudentName() With { _
    .FirstName = "Craig", _
    .LastName = "Playstead" _
}
When converting C# to Vb.Net using the [Online Converter](http://codeconverter.sharpdevelop.net/) i found two issues, #513 is the first, and this is the second. Code with object initializers like this ``` StudentName student2 = new StudentName { FirstName = "Craig", LastName = "Playstead", }; ``` is wrongly translated to this (notice the "Key " parts) ``` Dim student2 As New StudentName() With { _ Key .FirstName = "Craig", _ Key .LastName = "Playstead" _ } ``` instead of this ``` Dim student2 As New StudentName() With { _ .FirstName = "Craig", _ .LastName = "Playstead" _ } ```
christophwille commented 2016-02-10 00:24:23 -06:00 (Migrated from github.com)

The code converter feature is part of SharpDevelop 4.x, which doesn't use NRefactory 5. So the bugs would need to go to SharpDevelop for the old branches (however, it is unlikely that this would be fixed for 4.x)

The code converter feature is part of SharpDevelop 4.x, which doesn't use NRefactory 5. So the bugs would need to go to SharpDevelop for the old branches (however, it is unlikely that this would be fixed for 4.x)
beppe9000 commented 2016-02-12 07:25:15 -06:00 (Migrated from github.com)

Was the feature dropped?

Was the feature dropped?
christophwille commented 2016-02-12 09:41:20 -06:00 (Migrated from github.com)

SD5 does support only C# so far, so it simply isn't there for the obvious reason of no VB support.

SD5 does support only C# so far, so it simply isn't there for the obvious reason of no VB support.
beppe9000 commented 2016-02-12 10:05:10 -06:00 (Migrated from github.com)

I do not understand: has it been rewritten from scratch?

I do not understand: has it been rewritten from scratch?
christophwille commented 2016-02-12 10:06:55 -06:00 (Migrated from github.com)

NR5 is a complete rewrite, yes

NR5 is a complete rewrite, yes
beppe9000 commented 2016-02-12 10:09:29 -06:00 (Migrated from github.com)

Couldnt'y the old vb part be used as a dependency meanwhile? Or is it completely incompatible?

Couldnt'y the old vb part be used as a dependency meanwhile? Or is it completely incompatible?
christophwille commented 2016-02-12 10:13:01 -06:00 (Migrated from github.com)

Totally different architecture and design

Totally different architecture and design
beppe9000 commented 2016-02-12 10:22:25 -06:00 (Migrated from github.com)

Oh, I see.. Do you happen to know when (1month, 6 moths, 1 year, forever?) vb support will added?

Oh, I see.. Do you happen to know when (1month, 6 moths, 1 year, forever?) vb support will added?
dgrunwald commented 2016-02-12 15:47:41 -06:00 (Migrated from github.com)

We don't plan to add VB support.

NRefactory at this point is mostly dead -- we don't plan to add any new features, not even C# 6 support. Use Microsoft's Roslyn instead. It shouldn't be hard to write a code converter based on Roslyn, though I'm not aware of any such project.

We don't plan to add VB support. NRefactory at this point is mostly dead -- we don't plan to add any new features, not even C# 6 support. Use Microsoft's Roslyn instead. It shouldn't be hard to write a code converter based on Roslyn, though I'm not aware of any such project.
luca-saggese commented 2016-02-12 16:41:03 -06:00 (Migrated from github.com)

But what happened to NRefactory Roslyn's branch?
i was working on the VB plugin, but i see is now completed out of scope..

Will sharpdevelop use another plugin for syntax highlight / code completion other than nrefactory?

But what happened to NRefactory Roslyn's branch? i was working on the VB plugin, but i see is now completed out of scope.. Will sharpdevelop use another plugin for syntax highlight / code completion other than nrefactory?
dgrunwald commented 2016-02-13 04:02:59 -06:00 (Migrated from github.com)

The NRefactory Roslyn branch only ever contained refactorings ported to Roslyn. Those were moved to the RefactoringEssentials repository.

Pretty much everything else in NRefactory duplicates Roslyn, so there isn't really a point to having NRefactory anymore. MonoDevelop is moving to Roslyn instead. SharpDevelop doesn't have the manpower to move anywhere.

The NRefactory Roslyn branch only ever contained refactorings ported to Roslyn. Those were moved to the [RefactoringEssentials](https://github.com/icsharpcode/RefactoringEssentials) repository. Pretty much everything else in NRefactory duplicates Roslyn, so there isn't really a point to having NRefactory anymore. MonoDevelop is moving to Roslyn instead. SharpDevelop doesn't have the manpower to move anywhere.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-icsharpcode/NRefactory#514
No description provided.