Skip to content
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

API reference for Property #296

Open
zealisland opened this issue Apr 17, 2015 · 2 comments
Open

API reference for Property #296

zealisland opened this issue Apr 17, 2015 · 2 comments

Comments

@zealisland
Copy link

It seems the API reference generated for "Property" is questionable.

For example, look at the doc here: http://fsprojects.github.io/FSharpx.Collections/reference/fsharpx-collections-experimental-timeseries-1.html, pay attention to "StartDate", which is a property with a getter and setter

image

However, the generated doc shows it as two methods

image

One cannot really tell what it is and which one is getter and which one is setter.

Moreover, the signature for the 2nd one (which corresponds to the setter) does not seem to be right, it shows as

image

Should it be DateTimeOffset -> unit?

@matthid
Copy link
Member

matthid commented Apr 17, 2015

I actually looked into this (especially the signatures) some time ago and postponed it after noticing that this seems to be non-trivial to fix.
The problem is that all you see is directly given by FCS and (at the time) quite some refactoring had to be done to workaround FCS giving this signature. And actually I don't think it's a issue in FCS either we just inspect properties not "deep" enough (but it could very well be a FCS bug as well).

If someone takes a look at this: While investigating I found a related issue with constructors as well. The signature of constructors are always shown as "unit -> unit" (possible not true anymore).
There are unit tests for both here: matthid/FSharp.Formatting@e4592c2
Those unit tests assume we want to have "unit -> Class" for constructors, only one entry for a property (instead of getter and setter) and a simplified signature (type only or "index -> Type" for indexed properties).

As I noticed some other FCS API changes which could help here I might take another look at this once I find some time, if nobody takes it in the mean time.

@dungpa
Copy link
Contributor

dungpa commented May 23, 2015

@matthid I'm pretty sure this is doable by current state of FCS (at least for F#). The issue might be that FSharp.Formatting used an old metadata reader and hasn't been updated when FCS evolved.

For example, we could generate property getters and setters at the same place in VFPT: https://github.com/fsprojects/VisualFSharpPowerTools/blob/ca4d95583062519b581b108497a4448b947c9212/src/FSharpVSPowerTools.Core/SignatureGenerator.fs#L807-L810.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants