FSharp.TypeProviders.SDK icon indicating copy to clipboard operation
FSharp.TypeProviders.SDK copied to clipboard

Allow TP to provide compile errors/warnings

Open rojepp opened this issue 6 years ago • 3 comments

Description

Feature suggestion: It would be nice if a TP could contribute compile errors and warnings, with a file and a location in the file. For instance, if say the json parser for a json TP fails to parse and gives a line number in its error, we could propagate that info out to the user, with squigglies in the json file even.

Maybe TypeProviderConfig could have a mechanism to allow adding this info?

rojepp avatar Mar 27 '19 14:03 rojepp

Yes, I agree, providing warnings is important

dsyme avatar Mar 30 '19 00:03 dsyme

related: https://github.com/fsharp/fslang-suggestions/issues/729

smoothdeveloper avatar Mar 30 '19 00:03 smoothdeveloper

Warnings would be nice. Then we could really do dependant types as warnings: TypeProviders "compile" information sources to .NET types. However we have more knowledge on the types that what we really want to use: we want to use normal .NET types to make the usability easy. Compiler warnings could solve this.

Concrete example: a varchar(3) has max length 3 but for .NET usability reasons we don't want to create String3-class. So a string-class with compiler warning "You tried to insert "asdf" to varchar(3)" could be a good compromise.

Thorium avatar Apr 09 '19 12:04 Thorium