Skip to content

Conversation

@saul
Copy link
Contributor

@saul saul commented May 3, 2020

Non-user-facing change which will enable parameter name hints. I think I've covered most of the ways you could call a function in F#.

Looking for feedback on how I've implemented it. See the 'todo's mentioned in the code. There are definite caching improvements (e.g. caching arguments and caching mapping from argument => parameter) that can be added but I don't know the idiomatic way to implement them.

Todo:

saul added 4 commits May 3, 2020 19:31
Now supports no args, curried args, single args, new expressions, attribute constructors and more
# Conflicts:
#	ReSharper.FSharp/src/FSharp.Psi.Features/src/Util/FSharpMethodInvocationUtil.fs
Named arg error recovery is not yet working, hence the missing gold files
Copy link
Member

@auduchinok auduchinok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks gorgeous!
I've skimmed through it and left some comments, will do a closer review later.

[<FSharpTest>]
[<TestPackages("FSharp.Core")>]
[<TestReferences("System.Drawing", "System", "System.Core")>]
[<TestProjectOutputType(ProjectOutputType.CONSOLE_EXE)>]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be great to add ITestProjectOutputTypeProviderAttribute to the framework and to make FSharpTestAttribute implement it, defaulting to ProjectOutputType.CONSOLE_EXE. It'll allow override it on per-test basis but having Exe default will save us from having to add module Module everywhere. I'll look into it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do that when I split the test infra changes to be their own PR 👍

Copy link
Member

@auduchinok auduchinok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And a few comments for tests.


dispose { new IDisposable with override __.Dispose () = () }

---------------------------------------------------------
Copy link
Member

@auduchinok auduchinok May 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make NewExpr implement IArgument too (not necessarily as a part of this PR but still).


---------------------------------------------------------
(arg #0) => <no matching param>
(arg #1) => <no matching param>
Copy link
Member

@auduchinok auduchinok May 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could somehow make parameter groups for curried functions and match a here later.

type T() =
static member M(u: unit) = ()

{selstart}T.M(u = ()){selend}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the test case! If we're to change it later, we'll have to update the recorded behavior explicitly, which is good.

@auduchinok auduchinok merged commit aa63ca2 into JetBrains:net202 May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants