-
Notifications
You must be signed in to change notification settings - Fork 832
FCS: Enable error reporting with correct file name #14556
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
Conversation
|
I know it probably isn't a big deal, but I would prefer if this would be done without breaking binary compatibility. (in this case the code overhead is negligable) |
|
@T-Gro sure , I can change the PR. I was not sure how to best expose the |
Yep. Because adding an optional member to existing functionality requires recompilation (with no code changes on consumer side), but is binary breaking. A new overload would keep existing usages working. |
KevinRansom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As Tomas says, overloads are preferred for compatibility.
ef9bed6 to
909b6f5
Compare
909b6f5 to
f1088fc
Compare
|
@T-Gro , @KevinRansom I changed it to overloads. I also rebased it to use the new basline files for the API surface. the new overloads are: member EvalInteraction: code: string * scriptFileName: string * ?cancellationToken: CancellationToken -> unit
member EvalInteractionNonThrowing: code: string * scriptFileName: string * ?cancellationToken: CancellationToken -> Choice<FsiValue option, exn> * FSharpDiagnostic[]
member EvalExpression: code: string * scriptFileName: string -> FsiValue option
member EvalExpressionNonThrowing: code: string * scriptFileName: string -> Choice<FsiValue option, exn> * FSharpDiagnostic[]the existing ones: member EvalInteraction: code: string * ?cancellationToken: CancellationToken -> unit
member EvalInteractionNonThrowing: code: string * ?cancellationToken: CancellationToken -> Choice<FsiValue option, exn> * FSharpDiagnostic[]
member EvalExpression: code: string -> FsiValue option
member EvalExpressionNonThrowing: code: string -> Choice<FsiValue option, exn> * FSharpDiagnostic[]In my own tests the |
|
Thanks @vzarytovskii ! Is there also some fcs documentation to update ? |
I don't think there's, docs should be automatically generated |
|
Thanks for merging @vzarytovskii ! However, I did not find this in the new Nuget that was published yesterday. |
I don't think it made it to .200, it should be in the next .300 preview or our preview nuget feed. |

Currently, compiler errors in fsi evaluations via FCS always report an error in a file called
input.fsx.This pull request adds an
optional parameteroverload that allows specifying a filename related to an evaluated string.For example, calling
fsiSession.EvalInteraction( "1 + 1.0" )reportsinput.fsx (1,3)-(1,4) typecheck error The type 'float' does not match the type 'int'But the actual file where this string comes from might be named differently.
I don't want to use
fsiSession.EvalScript(path)since a file might not exist yet, or I might not be evaluating all lines of the current file.