-
Notifications
You must be signed in to change notification settings - Fork 123
Report printf specifiers from Service API #272
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
So how will this API be used? Great work by the way, what I wanted for XS was to present format specifiers in completion, thats a different thing to this though. |
It can be used similarly as |
Ah, so its a colourisation assist. |
|
||
if i >= len then failwithf "%s" <| FSComp.SR.forBadPrecision(); | ||
|
||
let acc = if precisionArg then (Option.map ((+)1) posi, g.int_ty) :: acc else acc | ||
let acc = if precisionArg then (Option.map ((+) 1) posi, g.int_ty) :: acc else acc |
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.
Please revert this kind of change too
I removed all unnecessary formatting changes (Sorry, I was itching whenever I saw formatting quirks.). |
This all looks good to me (except remove the laziness) |
Thanks. Laziness is now removed. |
So is the aim of this just to have strings and format strings highlighted differently? |
@dsyme It would be great if this PR were merged and the NuGet package were published. I could make the needed changes to VFPT then. |
@vasily-kirichenko Nice, I wish I had time to add more stuff to to XS. I wanted completion on the formatter semantics, so you could just choose the formatter you want when you cant remember the nemonic. Essentially the completion code would have to know you were in a |
@7sharp9 You can offer a fixed set of format specifiers for completion. Or do you want a smarter mechanism? |
@dungpa Oh a fixed set would be fine, its quite a help in C# it looks like this: I thought an F# one would be very useful. |
Yeah, it would be useful, but we don't touch intellisense in VFPT. @dungpa maybe it's better to suggest it to implement in VFT (together with intellisense colorization)? |
Main issue in XS was detecting that you were in a string argument of a string formatter function. Admittedly I never looked into it in detail. |
Report printf specifiers from Service API
add diagnostics message to autogen.sh
Close #174.
The PR seems to cover the most important cases:
One thing isn't very nice: ASTs don't preserve information whether a string is regular, verbatim or triple-quote. Consequently, we have to lookup the source string to recover that information and create correct offsets for reporting ranges.