LINQPad 9 - Early Preview now available
Comments
-
What's the issue with running ILSpy 8.2 with .NET 10?
I cannot make LINQPad work with ILSpy 9. While the command-line parameter issue is easy to fix, there's another problem with their new IPC mechanism. It essentially prevents LINQPad from reliably re-using a particular instance that it created. Will need to log a feature request with ILSpy when I get a chance to get this fixed.
-
@JoeAlbahari said:
What's the issue with running ILSpy 8.2 with .NET 10?Try pressing F12 on List on a line like :
List<string> x = new();
Or you can just run directly
"%localappdata%\LINQPad\ILSpy8.2\ILSpy.exe" "C:\Program Files\dotnet\shared\Microsoft.NETCore.App\10.0.0-preview.5.25277.114\System.Collections.dll" /navigateTo:T:System.Collections.Generic.List`1 /separateThe source of the line where It crashes is
as version is just 10.0 rather then 10.0.0
Not sure whether it is this line that is wrong or whether version should not be detected as 10.0 but 10.0.0.
-
Trying to add some extensions using the new syntax and getting an NRE in LINQPad with no details. Works fine if it's converted to the older syntax.
void Main() { typeof(Dictionary<string, ValueTuple<int, string, object>>).GetFriendlyName().Dump(); } public static class TypeExtensions { extension(Type type) { public string GetFriendlyName() { return Impl(type); static string Impl(Type type, bool skipGeneric = false) => Type.GetTypeCode(type) switch { TypeCode.Boolean => "bool", TypeCode.Char => "char", TypeCode.SByte => "sbyte", TypeCode.Byte => "byte", TypeCode.Int16 => "short", TypeCode.UInt16 => "ushort", TypeCode.Int32 => "int", TypeCode.UInt32 => "uint", TypeCode.Int64 => "long", TypeCode.UInt64 => "ulong", TypeCode.Single => "float", TypeCode.Double => "double", TypeCode.Decimal => "decimal", TypeCode.String => "string", TypeCode.Object when type == typeof(object) => "object", _ => type switch { { IsGenericType: true } when type.GetGenericTypeDefinition() == typeof(Nullable<>) => $"{Impl(Nullable.GetUnderlyingType(type)!, skipGeneric)}?", { IsGenericType: true } when typeof(ValueTuple).GetInterface("IValueTupleInternal")!.IsAssignableFrom(type) => ValueTupleName(type), { IsGenericType: true } when !skipGeneric => GenericTypeName(type), { IsNested: true } => $"{Impl(type.DeclaringType!, skipGeneric)}+{type.Name}", { IsArray: true } => $"{Impl(type.GetElementType()!, skipGeneric)}[]", { IsByRef: true } => $"out {Impl(type.GetElementType()!, skipGeneric)}", { IsPointer: true } => $"{Impl(type.GetElementType()!, skipGeneric)}*", _ => $"{type!.Namespace}.{type.Name}", }, }; static string ValueTupleName(Type tupleType) { // value tuples in practice will be generic and have at least 2 type parameters // though, non-generic and 1-tuple is possible, we'll ignore return $"({string.Join(", ", tupleType.GenericTypeArguments.Select(t => Impl(t)))})"; } static string GenericTypeName(Type genericType) { var typeParameters = new Queue<string?>(genericType.GenericTypeArguments.Select(t => Impl(t))); var nestedName = Impl(genericType, skipGeneric: true)!; return Regex.Replace(nestedName, @"`(\d+)", m => { var replacements = Enumerable.Range(0, int.Parse(m.Groups[1].Value)) .Select(_ => typeParameters.Dequeue()); return $"<{string.Join(", ", replacements)}>"; }); } } } }
-
This should now be fixed with the latest Roslyn update in 9.1.5
-
There seems to be an issue with the down-arrow after commenting out some code.
To reproduce, start with this example script"1".Dump(); "2".Dump(); "3".Dump(); "4".Dump(); "5".Dump();
Highlight the first line and press Ctrl-K, Ctrl-C to comment out the line.
Then when you press the down-arrow key to try to go down to the third or fourth line it doesn't do anything.
If you press the up-arrow everything starts working again.Also, when it is stuck, if you press return it brings up the LinqPad settings dialog box,
-
I noticed the caret disappears after. Maybe it's stuck in a chord mode? Uncommenting (Ctrl+K, Ctrl+U) doesn't have the same behavior. Toggling comments (Ctrl+/) doesn't appear to have this problem.
-
Thanks - this will be fixed in the next beta.
-
Thanks
-
This issue has cropped up several times, but I never manage to reproduce it simply until now.It is not entirely consistent as sometimes it goes wrong first time and other times you have to repeat the process two or three times.
Repo:
1. Open two scripts (Script 1 and Script 2) and make Script 2 display something (e.g. 2) 2. Switch to Script 1 3. Press F8 twice. 4. Switch to Script 2 5. Run this script. At some stage (maybe the first time) the results panel is shown without the contents. 6. Otherwise go back to Step 2.
The actual contents of the scripts don't matter and the issue happens even if the scripts are blank.
When this goes wrong it looks like this -
Pressing F8 will show the results in Full Screen mode and F8 shrinks them back and displays them properly, but once this happens it keeps happening (inconsistently) when switching to and running other scripts until LP is exited.
P.S. There may be an issue with the Ordered List feature of the forum editor. The numbers are added to the editor, but not shown when previewed, so I have marked the steps as code so that the numbers show up.
-
Thanks for the repro. This should be fixed in the next build.
-
In Settings|Editor->General the Appearance box has the Custom font capability but is missing the notice that was in LINQPad 8 on how to change the font size. It seems there is room to put that back on the right side of the box.
Also, the extension members sample has an error even though I have preview features enabled and changed .NET version to 10.0 - it can't find the
Count
extension. -
I don't think the new tab buttons work as well as the old tabs - they seem more like independent buttons instead of being associated with the content of the editor or results pane.
In addition the way the unselected tabs change shape because they overlap seems a bit strange.
-
It seems like the previous update added a weird child window bug when in dark mode. The background of the title bar is all white and text still white on black. And this is happening on many child windows (e.g., global settings, script settings, nuget package manager) but not all (e.g., database connection dialogs). I guess some styling is missing for dark mode, it looks normal in light mode.
-
Are you on Windows 10 by any chance? And if so, what version does
Environment.OSVersion
report? -
@JoeAlbahari said:
Are you on Windows 10 by any chance? And if so, what version doesEnvironment.OSVersion
report?I'm using the following version and got same issue:
Platform ServicePack Version VersionString
-------- ----------- ------- -------------
Win32NT 10.0.19045.0 Microsoft Windows NT 10.0.19045.0 -
Using Windows 10 Enterprise, though I'm not at work right now.
In Windows settings, I actually have "Title bars and window borders" using the accent color at home so it doesn't manifest the same. It looks fine.
But if disabled, it will show the same problem. Same exact version as JoeYellow_ming.
-
Thanks - I've now reproduced this in a Win10 VM. There will be a fix in the next build.
-
About pressing the "Ctrl" key on the keyboard and clicking the hyperlink in the Code Editor
-
Looks like a RegEx issue. Will get this fixed.
-
Hi,
I’m wondering if LINQPad 9 for macOS will include support for Charts.
Thanks!
-
It will be supported at some stage - most likely using Oxyplot as the backend instead of the WinForms charting library. I don't have a timeline right now, but am hoping for September/October this year.