CSharpToVB icon indicating copy to clipboard operation
CSharpToVB copied to clipboard

"Range Sugar" issue...

Open DualBrain opened this issue 4 years ago • 1 comments

Was working my way through some samples located at https://blog.ndepend.com/top-10-new-net-6-0-api/

The LINQ now works with Index and Range operators...

// 6 element indexed from 0 to 5 var arr = new [] {0, 1, 2, 3, 4, 5}; Assert.IsTrue(arr.ElementAt(^2) == 4); // Take the second element from the end

This fails to convert... will have to think how to handle translating to VB. My initial reaction is that the ^2 basically translates to the length of the variable containing the elements minus the value, so something like:

AssertIsTrue(arr.ElementAt(arr.Length - 2) = 4)

May also have to look at the ^2...2 version as well.

DualBrain avatar Nov 10 '21 03:11 DualBrain

@DualBrain I think I only partly support that feature. I will look at it or you can if you want something simple to work on. Just fork the repo and create a branch for this. also if you want to finish Dark Mode, that should be a separate branch.

paul1956 avatar Nov 10 '21 23:11 paul1956