Ionide-vscode-fsharp: Show correct line number for fsi errors

Created on 15 Feb 2019  路  2Comments  路  Source: ionide/ionide-vscode-fsharp

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.

Steps to reproduce

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.
*)

Comparison to Visual Studio Error with the correct line number

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.

*)
wontfix

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.

All 2 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cartermp picture cartermp  路  4Comments

alfonsogarciacaro picture alfonsogarciacaro  路  5Comments

MikaelUmaN picture MikaelUmaN  路  5Comments

sergey-tihon picture sergey-tihon  路  6Comments

isaacabraham picture isaacabraham  路  5Comments