Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Selective Type Provider Error Highlighting #729
Selective Type Provider Error Highlighting
I propose we add selective error highlighting for type providers that permits the type provider to add red squiggles to any part of the string instead of strictly the entire string.
do use cmd = new SqlCommandProvider<" SELECT TOP(@topN) FirstName, LastName, SalesYTD _FRMO_ Sales.vSalesPerson WHERE CountryRegionName = @regionName AND SalesYTD > @salesMoreThan ORDER BY SalesYTD " , connectionString>(connectionString) cmd.Execute(topN = 3L, regionName = "United States", salesMoreThan = 1000000M) |> printfn "%A"
in this example the whole SqlCommandProvider would be red in how it works now instead of simply highlighting "FRMO" which should be "FROM".
The existing way of approaching this problem in F# is to make the whole string red.
Pros and Cons
The advantages of making this adjustment to F# are ...
It makes existing usages of type providers more user friendly. It also goes well with this proposal. #556
The disadvantages of making this adjustment to F# are ...
Estimated cost (XS, S, M, L, XL, XXL):
Affidavit (please submit!)
Please tick this by placing a cross in the box:
Please tick all that apply:
I tend to move those into separate .sql (or .json, whatever it is) files.
Editing the .sql file will show the error.
What would be amazing is if the type provider could report resources (uris for example) to the tooling, so an error in the resource would show as a link to edit the faulty file.
Having that feature in F# + TP SDK is indeed a first step in that direction and perfectly blends with what has been driving the TP so far. +1.