Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show correct line number for fsi errors #1020

Closed
nhirschey opened this issue Feb 15, 2019 · 2 comments
Closed

Show correct line number for fsi errors #1020

nhirschey opened this issue Feb 15, 2019 · 2 comments
Labels
wontfix Suggestions or problems that won't be fixed

Comments

@nhirschey
Copy link

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 #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.

*)
@Krzysztof-Cieslak
Copy link
Member

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.

@Krzysztof-Cieslak Krzysztof-Cieslak added the wontfix Suggestions or problems that won't be fixed label Mar 15, 2019
@reinux
Copy link

reinux commented Jul 1, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix Suggestions or problems that won't be fixed
Development

No branches or pull requests

3 participants