ionide / ionide-vscode-fsharp

VS Code plugin for F# development
http://ionide.io
MIT License
858 stars 277 forks source link

[7.20.2] Error when executing code in an fsx file #2017

Closed mrboring closed 3 months ago

mrboring commented 3 months ago

Describe the bug

Error when executing code in an fsx file.

image

The issue does not occur with 7.20.1.

Steps to reproduce

  1. Create an fsx file.
  2. Enter a single line with: open System.
  3. With the cursor on the above line do ALT+ENTER.

Expected behaviour

> # silentCd @"c:\Data\FSharp\Projects\<REMOVED>\tests\DO NOT COMMIT";;
- # 1 @"c:\Data\FSharp\Projects\<REMOVED>\tests\DO NOT COMMIT\issue.fsx"
- open System;;
>

Screenshots

Notification appears when doing ALT+ENTER

image

Machine info

fwaris commented 3 months ago

https://github.com/microsoft/vscode/issues/216543

this is getting executed at fsi launch. dotnet fsi -fsi-server-input-codepage:28591 --fsi-server-output-codepage:65001

There seems to be a dash missing. Need -- (two dashes) before fsi-server-input...

stmax82 commented 3 months ago

We're getting the same error since restarting VS Code today. The problem was introduced in yesterday's Ionide update version 7.20.2.

Reverting back to version 7.20.1 (as recommended in the linked issue above) solves the problem: image

baronfel commented 3 months ago

Thanks for the reports folks, well take a look and try to see what's going on.

baronfel commented 3 months ago

Are any of you passing the following settings?

fwaris commented 3 months ago

This is my settings file - not passing any parameters (I removed workspace settings and the problem still persists so they are not affecting this issue):

{
    "terminal.integrated.confirmOnExit": "always"

}

Reverting to older version of ionide fixes this issue. It seem this issue got introduced with 7.20.2.

The linked or referenced issue shows how you can debug launch failures with "code --trace log" command. That is how I found the actual command line and parameters that VS was sending to powershell (i think).

See https://github.com/microsoft/vscode/wiki/Terminal-Issues#enabling-trace-logging

baronfel commented 3 months ago

This is entirely my fault - I messed up the binding of the parameters from the VSCode configuration. A new release with the fix is building now! The fix is in https://github.com/ionide/ionide-vscode-fsharp/commit/3f9cf1bd4974dd603c4c6347baeb6a316ff0568d and released in version 7.20.3.

mrboring commented 3 months ago

I'm still having this issue with 7.20.3.

image

image

As with 7.20.2, reverting to 7.20.1 fixes this issue.

baronfel commented 3 months ago

What .NET SDK are you using?

mrboring commented 3 months ago
> dotnet --info
.NET SDK:
 Version:           8.0.302
 Commit:            ef14e02af8
 Workload version:  8.0.300-manifests.f6879a9a
 MSBuild version:   17.10.4+10fbfbf2e

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\8.0.302\

.NET workloads installed:
There are no installed workloads to display.

Host:
  Version:      8.0.6
  Architecture: x64
  Commit:       3b8b000a0e

.NET SDKs installed:
  2.1.202 [C:\Program Files\dotnet\sdk]
  2.1.526 [C:\Program Files\dotnet\sdk]
  2.2.101 [C:\Program Files\dotnet\sdk]
  2.2.402 [C:\Program Files\dotnet\sdk]
  3.0.100 [C:\Program Files\dotnet\sdk]
  3.1.426 [C:\Program Files\dotnet\sdk]
  5.0.101 [C:\Program Files\dotnet\sdk]
  5.0.203 [C:\Program Files\dotnet\sdk]
  5.0.214 [C:\Program Files\dotnet\sdk]
  5.0.303 [C:\Program Files\dotnet\sdk]
  5.0.408 [C:\Program Files\dotnet\sdk]
  6.0.100 [C:\Program Files\dotnet\sdk]
  6.0.131 [C:\Program Files\dotnet\sdk]
  6.0.203 [C:\Program Files\dotnet\sdk]
  6.0.321 [C:\Program Files\dotnet\sdk]
  6.0.423 [C:\Program Files\dotnet\sdk]
  8.0.106 [C:\Program Files\dotnet\sdk]
  8.0.206 [C:\Program Files\dotnet\sdk]
  8.0.302 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.31 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.31 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.17 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.31 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Is there any code I can run in the fsx file that will show me what version of the .NET SDK it thinks it's using?

fwaris commented 3 months ago

fyi 7.20.3 fixed the issue for me

dotnet --info attached Command Prompt.txt

baronfel commented 3 months ago

There are two issues in this report I think:

mrboring commented 3 months ago

@baronfel Have you made any progress looking into this issue?

baronfel commented 3 months ago

No, sadly. I haven't been able to repro it on my end to dig in further yet.

mrboring commented 3 months ago

Strange!

I've now tried updating to 7.20.3 on three PC's all of which give the above error. This is two Win 10 and one Win 11. On two of the PC's I removed all extensions apart from:

.NET Install Tool v2.0.7 C# v2.34.12 Ionide for F# v7.20.3

Unfortunately, I have no problem reproducing the issue (d'oh!).

mrboring commented 2 months ago

@baronfel Somehow I managed to miss your reply:

Are any of you passing the following settings?

* FSharp.fsiExtraParameters

* FSharp.FSIExtraSharedParameters

* FSharp.FSIExtraInteractiveParameters

I setup a VM with VSCode and Ionide only. It works with no errors. I then replaced the settings.json with the one from my main PC and got the error. Looking through the settings.json file I found:

"FSharp.fsiExtraParameters": [
    "--multiemit-"
],

With the following warning:

This setting can lead to errors when providing both FSI-CLI-only and script-typechecking-related parameters. 
Please use `#FSharp.FSIExtraInteractiveParameters#` for FSI-CLI-specific parameters, 
and `#FSharp.FSIExtraSharedParameters#` for typechecking-related parameters.(2)

I removed this and the error went away. I think I have this issue on multiple PC's because my settings were synced. Can't remember setting this value.

Thanks for your help, and sorry for wasting your time by not reading your replies properly.