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

Improve .NET POCO Initialiser Constructor object documentation, unit -> unit is not useful, we want to see the signature #1224

Open
3 of 4 tasks
jkone27 opened this issue Jan 19, 2024 · 2 comments

Comments

@jkone27
Copy link
Contributor

jkone27 commented Jan 19, 2024

Details

atm, dotnet reference types constructor just show unit unit if they have an empty constructor, but that is not useful as the developer many time, even for poco objects, wants to see the public properties names, and be suggested with them on how to fill in a common .NET object coming from a nugget library or a C# project.

// empty constructor is currently returned in suggestions from autocomplete for C# Poco classes
() -> ()

is not a useful signature for the developer, because he can also use the object constructor (curly constructor from C#) in F# using parentheses and specifying named arguments

// common C# POCO
public class SomeThing {
   public string PropertyOne { get; set; }
}
// actual "poco" initializer the dev is interested into and to see in docs
new SomeThing(
    PropertyOne="A"
    )

Checklist

  • I have looked through existing issues to make sure that this feature has not been requested before
  • I have provided a descriptive title for this issue
  • I am aware that even valid feature requests may be rejected if they do not align with the project's goals
  • I or my company would be willing to contribute this feature
@baronfel
Copy link
Contributor

Sounds reasonable! Let me make sure I understand the request:

When triggering completion in a constructor, if at the end of the constructor parameter list, users should see any settable properties (in C# terms this is set or init properties) in the completion list

Is that accurate?

@jkone27
Copy link
Contributor Author

jkone27 commented Jan 20, 2024

Yes indeed, I just find it sometimes painful to work with c# poco objects initialiser from F#, it works but syntax is not clear , not well documented and not suggested by the autocomplete/inline-docs. So I think this can help many beginners , maybe I would also mention that curls in C# are replaced by normal
Parents in F#? Or maybe a custom computation expression working only with POCOS like

type MyPoco() =
    member val this.Test = "" with get,set

// only unit -> unit is suggested here, not to fill in with Test property which has a public setter..
let x = new MyPoco()

Would make it even closer to C# for pocos and easier to bridge the gap?

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

No branches or pull requests

2 participants