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

No completion for "call" method on Function objects #39761

Closed
shinayser opened this issue Dec 12, 2019 · 10 comments
Closed

No completion for "call" method on Function objects #39761

shinayser opened this issue Dec 12, 2019 · 10 comments
Assignees
Labels
analyzer-completion Issues with the analysis server's code completion feature area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.

Comments

@shinayser
Copy link

shinayser commented Dec 12, 2019

At the current version of dart sdk (2.7.0) we don't have a completion for the "call" method for function types. This is leading to third party sollutions to fix this problem, as of: simc/dartx#16 (comment)

image

@vsmenon vsmenon added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-completion Issues with the analysis server's code completion feature labels Dec 12, 2019
@pq pq self-assigned this Jan 15, 2020
@pq
Copy link
Member

pq commented Jan 22, 2020

WIP (https://dart-review.googlesource.com/c/sdk/+/132920):

image

Note that since call has no backing element (in the analyzer's element model) it is not rendered w/ the method icon (or return type displayed). If this is significant, we'll want to accommodate this special case on the client(s) side(s) (e.g., IntelliJ and VS Code).

@pq
Copy link
Member

pq commented Jan 22, 2020

Issue tracking IntelliJ cosmetics: https://youtrack.jetbrains.com/issue/WEB-43413.

/fyi @DanTup in case you want to track this for VS Code.

@DanTup
Copy link
Collaborator

DanTup commented Jan 22, 2020

@pq thanks! I'll try it out and see how it looks. If I understand that issue correctly, the reason it doesn't appear the same is that IntelliJ is using its own data structures for this? In VS Code everything comes from the server, so if this shows up like any other method, I'd expect it to just work. I'll give it a test to confirm though!

@pq
Copy link
Member

pq commented Jan 22, 2020

Thanks @DanTup. The issue is that ordinary method suggestions have a method element associated with them and that's how clients know it's a method invocation. These do not (since call isn't part of the actual element model and is a kind of magic method). To clients these will just look like invocations but the logic they use to decorate them as methods (vs. property accessors for example), won't "just work" and so we'll need to special case them I think.

Feel free to ping me if you hit any snags.

@bwilkerson
Copy link
Member

Could we do the special casing on the server side (by sending the information we would have sent had there been an element for it)?

@pq
Copy link
Member

pq commented Jan 22, 2020

Ah, OK. @bwilkerson, yes. I was being thick. Looking at this again, I think we can. Will follow-up...

@pq
Copy link
Member

pq commented Jan 22, 2020

@DanTup: please ignore, I've got a fix in flight on the server side. Everything should now "just work". Sorry for the noise!

@DanTup
Copy link
Collaborator

DanTup commented Jan 24, 2020

@pq np, and thanks! Is it https://dart-review.googlesource.com/c/sdk/+/133001? If so, is there anything special I need to do to see this? Using the most recent nightly (2.8.0-edge.a4aaaf05eb34bc07686f7480a0da7f056f284b91 (Fri Jan 24 11:40:59 2020 +0000)) I don't see the call() completion:

Screenshot 2020-01-24 at 12 21 11

@DanTup
Copy link
Collaborator

DanTup commented Jan 24, 2020

Oops, user error. I was using the a sample project that was pointing at running the analyzer from source (and my local folder wasn't up-to-date) 🙈

Looks as expected :-)

Screenshot 2020-01-24 at 12 22 23

@pq
Copy link
Member

pq commented Jan 24, 2020

Sweet!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-completion Issues with the analysis server's code completion feature area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
Projects
None yet
Development

No branches or pull requests

5 participants