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

VB -> C#: Literal XML in element lookup does not convert #503

Closed
odigon opened this issue Jan 16, 2020 · 1 comment
Closed

VB -> C#: Literal XML in element lookup does not convert #503

odigon opened this issue Jan 16, 2020 · 1 comment
Labels
VB -> C# Specific to VB -> C# conversion

Comments

@odigon
Copy link

odigon commented Jan 16, 2020

Input code

Private Sub LoadValues(ByVal strPlainKey As String)
            Dim xmlFile As XDocument = XDocument.Parse(strPlainKey)

            Dim objActivationInfo As XElement = xmlFile.<ActivationKey>.First
End Sub

Erroneous output

private void LoadValues(string strPlainKey)
    {
        XDocument xmlFile = XDocument.Parse(strPlainKey);
        ;
#error Cannot convert LocalDeclarationStatementSyntax - see comment for details
        /* Cannot convert LocalDeclarationStatementSyntax, CONVERSION ERROR: Conversion for XmlElementAccessExpression not implemented, please report this issue in 'xmlFile.<ActivationKey>' at character 199


        Input:

                    Dim objActivationInfo As XElement = xmlFile.<ActivationKey>.First

         */
    }

Expected output

private void LoadValues(string strPlainKey)
{
       var xmlFile = XDocument.Parse(strPlainKey);
       var objActivationInfo = xmlFile.Elements("ActivationKey").First();
}

Details

  • Product in use: e.g. codeconverter.icsharpcode.net / VS extension / both
  • Version in use: e.g. 5.6.3 or a commit hash (if it's a 3rd party tool using this library, try one of the above) 7.6.0.0
  • Did you see it working in a previous version, which? no
  • Any other relevant information to the issue, or your interest in contributing a fix.
@odigon odigon added the VB -> C# Specific to VB -> C# conversion label Jan 16, 2020
@GrahamTheCoder
Copy link
Member

Thanks for the bug report and nice example. I've just pushed a fix to master. There is a fair amount more work to do to fully support xml syntax. Feel free to add other examples into #253 to use as test cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VB -> C# Specific to VB -> C# conversion
Projects
None yet
Development

No branches or pull requests

2 participants