FSI shows the line number of an error relative to the lines of code that is submitted in the call. It would be more useful if FSI showed errors relative to the lines in the file like in Visual studio.
I recognize that perhaps this will not be added for the same reason as https://github.com/ionide/ionide-vscode-fsharp/issues/300, but this is one reason I am mostly using Visual Studio these days despite preferring the general ionide setup.
open System
let x = 3
printfn "%f" x
send lines 1 .. 4 to FSI. Error is on line 5.
(*
C:\Users\user\Untitled-1(5,14): error FS0001:
The type 'int' is not compatible with any of the types float,float32,
Decimal, arising from the use of a printf-style format string
*)
Now send line 4 to FSI again. Error is on line 6.
(*
C:\Users\user\Untitled-1(6,14): error FS0039: The value or constructor 'x' is not defined.
*)
open System
let x = 3
printfn "%f" x
// send lines 1 .. 4 to FSI. Error is on line 4.
(*
~vsC4C.fsx(4,14): error FS0001: The type 'int' is not compatible with any of the types float,float32,Decimal, arising from the use of a printf-style format string
*)
// Now send line 4 to FSI again. Error is still on line 4.
(*
~vsC4C.fsx(4,14): error FS0039: The value or constructor 'x' is not defined.
*)
Yes, unfortunately, we won't do this for the same reason I closed #300. Sorry for the inconvenience, but it's hard to do anything in this case.
Exceptions are complicated enough to debug in F# as it is, especially with computation expressions. I can't see myself using Ionide until there's a solution to this.
Do we have any information on how VS manages it? Hell, I'd take having it run in a separate terminal window over not being able to see the line numbers. In fact, I'd take the output being "noisy" with #line directives everywhere.
Most helpful comment
Exceptions are complicated enough to debug in F# as it is, especially with computation expressions. I can't see myself using Ionide until there's a solution to this.
Do we have any information on how VS manages it? Hell, I'd take having it run in a separate terminal window over not being able to see the line numbers. In fact, I'd take the output being "noisy" with #line directives everywhere.