Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix conversion with ambiguous names [#332] #416
When an unqualified name is used in VB, the converted C# did not qualify it if it would become ambiguous.
When converting a generic name, qualify it if possible to ensure we select the right reference.
Adding the test case took a really long time - since I needed multiple files for this, I couldn't just paste in strings, and there's no documentation for how the characterisation tests work (at least that I could see). I spent a huge amount of time dealing with copy/pasting random bits of solution files, as well as trying to remove/add trailing whitespace so things matched.
Sorry it was a hassle to add a characterization test. Is
The first place I looked was CONTRIBUTING.md, to see if there was a "here's where to add tests for multiple files".
I then looked at SolutionAndProjectTests.cs, since this was the only place I'd seen tests which touched more than one file (I wasn't sure if it was the right place, since it primarily seemed to test project/solution conversion rather than specific code). I looked briefly at
Then I took a stab in the dark to try and figure out what was going on. It took me to near completion to realise:
I manually copy/pasted/tweaked things in until it worked - I didn't find the
Thanks for your thoughts on the characterization tests. I've opened #419 so it doesn't distract from and clutter another PR, but I will try and get on it soon. Sorry again for the pain, please do highlight other specific things that could be made easier. It is tricky enough to get contributors with just the high level of domain knowledge on VB/CS/compilers needed, without the codebase adding further difficulties.
I like to keep as much of the documentation either as naming in the code or xmldoc as possible, but there's probably some overview stuff we should add around the general shape of things, e.g. The snippet detection, the automatically guessed references, the different visitors, comment conversion, the simplifier, how errors are handled.