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

implement getting signature of function #129

Closed
wants to merge 5 commits into from
Closed

implement getting signature of function #129

wants to merge 5 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jan 31, 2015

I'm trying to implement feature from issue #41.

This is not ready yet, I just wanted to ask something. I used find_definition_ to get declaration of the requested function, but in the complex case on the test, the contextstr is
"pub fn string_to_parser<' 'a ParseSess, source_str: String) -> Parser<'"
so few chars at the end are missing.

Is this a bug of the find_definition_ function?

@ghost
Copy link
Author

ghost commented Feb 1, 2015

Nevermind, I could do this without find_definition_ (assuming supplied coordinates point at declaration already, which should happen if racer was used to get them).

Btw, have you considered using json data? Seems like it would be easier to parse on the other side, and could be maybe mapped later in library when returning structs.

EDIT: I just noticed that SublimeText doesn't have event when completion is selected, so all method data has to be passed on completion query :/. I wonder if we could add this info to the completion data? On Sublime for snippets to work it would look like this:
add(${0:a: i32}, ${1:b: i32})
I don't know how compatible it is with other editors, seems quite popular though.

@phildawes
Copy link
Collaborator

Hi @krzat. I don't know sublimetext (I code rust in emacs), Can you use another key to trigger function signature getting? E.g. in intellij you use ctrl-p to get arguments

@ghost
Copy link
Author

ghost commented Feb 2, 2015

I could probably do that, but pressing Ctrl+P every time user calls
function isn't very convenient. I will try observing '(' press and
determining if its function call,but its still not as good as inserting it
at the completion, IMO.

I was asking about JSON, because it would be easier to bake additional data
like this without breaking anything.

@ghost
Copy link
Author

ghost commented Feb 2, 2015

Anyway, the functionality from #41 seems to be achieved (except I added NAME to return name of the function too), so it's ready to merge (unless you have some problems with the code).

@ghost
Copy link
Author

ghost commented Feb 3, 2015

closing for now, it won't work properly across files

@ghost ghost closed this Feb 3, 2015
This pull request was closed.
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