-
Notifications
You must be signed in to change notification settings - Fork 123
Provide API that includes printf specifier arities along with ranges #527
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
…ier along with its range This is needed if one wants to accurately map arguments -> specifiers or specifiers -> arguments. A specifier can take 0, 1, 2, or 3 args: - printfn "%%" // 0 args - printfn "%*%" // 1 arg - printfn "%*.*%" // 2 args - printfn "%*.*f" // 3 args
@@ -262,6 +262,9 @@ type FSharpCheckFileResults = | |||
/// <summary>Get the locations of format specifiers</summary> | |||
member GetFormatSpecifierLocations : unit -> range[] |
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 add Obsolete to this, with a message to use the new method
Great work! There's a test failure, suspect it won't be too hard to fix
|
Whoops, thanks. All should be good now. |
Provide API that includes printf specifier arities along with ranges
@rneatherway Would you be able to push a new nuget package? @latkin Would you like to have publish-the-package rights? There's no one better qualified :) |
Sure, I'd be honored |
@latkin OK you have invitations to Write access to this repo and to the two nuget package repos. Think that's all you need to publish. I find the build.fsx publishing process can go wrong sometimes in different repos. It seems best to build+test the nupkg and push it manually, and then do GenerateDocs and ReleaseDocs carefully too. On occasion in different repos ReleaseDocs has nuked the whole contents of the github-pages branch, requiring a forced push or two. |
That is great if someone who uses Windows can do the releases. I never managed to create a single Windows installation where the tests passed and the SourceLink stuff worked. |
FWIW tests don't pass on my machine, either. |
Tests pass on mine, at least last time I checked. @latkin could you please paste in the errors you're getting? I don't know what is going on with SourceLink and CRLF/LF. One repo copy on my machine has CRLF and the other has LF. SourceLink only agrees to build the nuget with one of them. I'll file a SourceLink bug. |
Add the sourcelink issue here: ctaggart/SourceLink#119. Until then feel free to disable the SourceLink step if it fails while preparing a release. |
ok, I'll clone/build/test clean later on and open an issue with failures. |
If I use |
I have a tiny PR at #528 that gives me a clean run-through of both the tests and SourceLink. This VM has VS2015 and the Windows 10 debugging tools installed. |
Guys, if you publish the nupkg files built by AppVeyor, you can just run |
That sounds great, is it easy to promote them? |
I've released 2.0.0.5 which includes this change. I can now do a full |
Motivation: fsprojects-archive/zzarchive-VisualFSharpPowerTools#1335
Tools that wish to map from specifier->argument(s) or vice versa need to know not only the range of the specifier, but also its arity. Most usages involve only 1 argument per specifier, but there are special cases with
*
width and/or precision slots, or the%a
specifier, which add additional arguments.Closely related -
%%
/%*%
/%*.*%
will now be reported as a format specifiers (with arity 0/1/2).