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

Add a way to get the signature of a function #41

Open
emberian opened this issue Aug 13, 2014 · 6 comments
Open

Add a way to get the signature of a function #41

emberian opened this issue Aug 13, 2014 · 6 comments

Comments

@emberian
Copy link

For example, racer signatureof fully::qualified::name might print fn(int) -> Box<String>. Would also want this to work on methods, ideally.

@phildawes
Copy link
Collaborator

I'm wondering how best to output this information from racer. I was
thinking an arg per output line (since function args themselves can include
commas (e.g. lambdas, generic args). Something like

% racer signatureof
RETURNS MyStruct<int,String>
ARG foo: int
ARG bar: Vec
ARG baz: |foo: int, bar: String|

Does that sound good to you?

Cheers,

Phil

On Wed, Aug 13, 2014 at 8:22 AM, Corey Richardson [email protected]
wrote:

For example, racer signatureof fully::qualified::name might print fn(int)
-> Box. Would also want this to work on methods, ideally.


Reply to this email directly or view it on GitHub
#41.

@c-cube
Copy link

c-cube commented Jul 15, 2015

This would be very nice to have. A similar project (in OCaml) binds this feature to <Leader> t, and it is extremely useful in presence of type inference. Almost as useful as completion imho.

Another related feature (possibly more complicated) is to display the type of a selected expression (rather than symbol).

@llogiq
Copy link

llogiq commented Jul 16, 2015

What about where and generics?

Something like

BOUND 'a
BOUND T
RETURNS MyStruct<int,String> 
ARG foo: int 
ARG bar: Vec<String>
ARG baz: F
ARG frob: &'a T
WHERE F: FnOnce(&T) -> bool

perhaps?

@phildawes
Copy link
Collaborator

Sounds reasonable to me

@oblitum
Copy link

oblitum commented Sep 12, 2015

I'm seeing at the ReadMe that function signature is being shown. How is that happening? I don't have the same in Vim, any tip how to get it?

@oblitum
Copy link

oblitum commented Sep 12, 2015

I see completion from command line is indeed returning more data than just identifier, so I guess the vim plugin was not updated to mirror that but the emacs part was?

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

5 participants