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

More concise completion info with OptionalAttribute/DefaultParameterValueAttribute #1310

Open
3 of 4 tasks
ieviev opened this issue Jul 9, 2024 · 1 comment
Open
3 of 4 tasks

Comments

@ieviev
Copy link

ieviev commented Jul 9, 2024

Details

C# style optional arguments take up a lot of space in completions:

image

The full namespace is explicit to show that it expands when System.Runtime.InteropServices is not opened.
This could be condensed to something like name : string, args : string = "", workDirectory: string = ""

Example of how it currently looks like in Rider:

image

I haven't checked how it looks like in Visual Studio, essentially the idea is it could display the constructor in System.Runtime.InteropServices.DefaultParameterValue() or the default type value

the snippet itself:

type Process() =
    static member inline wait
        (
            name: string,
            [<
                System.Runtime.InteropServices.Optional; 
                System.Runtime.InteropServices.DefaultParameterValue("")>] 
                args: string,
            [<
                System.Runtime.InteropServices.Optional; 
                System.Runtime.InteropServices.DefaultParameterValue("")
            >] 
                workDirectory: string
        ) =
        // ..
        ()

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

baronfel commented Jul 9, 2024

This would be great - the current 'signature help' implementation is creating the output you see here and I'd love to see PRs here to fix this horrible layout!

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

2 participants