-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Ranking/sorting of code completion is worse with suggestion sets #38739
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
Comments
To sum up there was a community request to enable completion for non imported identifiers and problems occur if the client subscribe for completion service:
Thanks to @scheglov the problem was helped a bit on the dev channel but the relevance is still high in the local file for all the identifiers.
Current workarounds (if you are satisfied with the manual import):
|
Any follow up on this issue ? |
Yes, we are actively discussing how best to address this situation and I think we're getting close to having a plan. I don't know how long it will take to implement, but it should get better eventually. |
It's been quite some time, and it's getting worse. |
Edit: Moved this comment to #43657 (comment), since that issue seemed to better describe my repro, whereas this one was specifically about suggestion sets ranking. |
Hope it gets fixed soon :( |
Any updates @DanTup ? |
the workaround doesn't work after Flutter 1.20.4. |
It's a bug that the |
I've tried to set LSP and "dart.autoImportCompletions" to false. |
@waleedf112 sorry, you seem to be correct - disabling LSP and auto-import-completions does still result in worse ranking than the screenshot shown at the top here. @bwilkerson I'm not sure if this is known or a new/different bug. My understanding was that the ranking with SuggestionSets wasn't as good because of less type information, though with suggestion sets disabled the {
"kind": "INVOCATION",
"relevance": 517,
"completion": "EdgeInsets.all",
{
"kind": "INVOCATION",
"relevance": 564,
"completion": "hashCode", |
Me either.
It's true that suggestion sets don't currently contain enough information to use type information, so that seems like a likely cause for the relevance results we were seeing. This certainly suggests that there's also a problem when we aren't using suggestion sets. Unfortunately, because of having two code paths for suggesting |
I am so much frustrated 😤 because of this behaviour of flutter :(
…On Thu, Mar 4, 2021 at 11:08 PM Brian Wilkerson ***@***.***> wrote:
I'm not sure if this is known or a new/different bug.
Me either.
My understanding was that the ranking with SuggestionSets wasn't as good
because of less type information ...
It's true that suggestion sets don't currently contain enough information
to use type information, so that seems like a likely cause for the
relevance results we were seeing.
This certainly suggests that there's also a problem when we aren't using
suggestion sets. Unfortunately, because of having two code paths for
suggesting EdgeInsets.all there could easily be multiple issues.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#38739 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIRXJSBUL3F24X6OHIBZ7XLTB7EA5ANCNFSM4I6HHMCQ>
.
|
I'm sorry the tools are causing frustration, and I completely understand why. I've done some digging and I have found two issues that impact this behavior:
I have a couple of ideas for how to solve the first issue, and I have just landed a CL to address the second issue (https://dart-review.googlesource.com/c/sdk/+/190281). |
Thanks for the feedback. I hope this gets resolved soon as it is a very
pressing situation for beginners who know nothing of widget properties
…On Wed, Mar 10, 2021 at 10:15 PM Brian Wilkerson ***@***.***> wrote:
I'm sorry the tools are causing frustration, and I completely understand
why.
I've done some digging and I have found two issues that impact this
behavior:
- It's giving too much weight to members defined on the implied target
of this.
- It's not using the type of the parameter to give higher priority to
static members.
I have a couple of ideas for how to solve the first issue, and I have just
landed a CL to address the second issue (
https://dart-review.googlesource.com/c/sdk/+/190281).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#38739 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIRXJSCR2SZTLRBTRSSLBZDTC6LLNANCNFSM4I6HHMCQ>
.
|
I have attempted to improve the first part of the issue with https://dart-review.googlesource.com/c/sdk/+/190581. Unfortunately I am not yet seeing any improvements in IntelliJ, which uses available declaration support. |
Thanks for the feedback.
…On Tue, Mar 16, 2021 at 1:26 AM Brian Wilkerson ***@***.***> wrote:
I have attempted to improve the first part of the issue with
https://dart-review.googlesource.com/c/sdk/+/190581. Unfortunately I am
not yet seeing any improvements in IntelliJ, which uses available
declaration support.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#38739 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIRXJSG36IN6TCUZHIGUROTTDZUPJANCNFSM4I6HHMCQ>
.
|
new progress in the master channel, code completion is better now, yet not perfect. when viewing code suggestions, now I see the appropriate values: a small and minor problem, if the suggested value was a function call, for example: it completes it as an Enum or a Type, not a function call like this:
dart settings:
finally, I can upgrade from Flutter 1.20.4 😂. |
Thanks For the Heads Up! i really hope they make it much better every week
now! also keep finding more goodies
…On Fri, Apr 2, 2021 at 12:32 AM Waleed Alenazi ***@***.***> wrote:
new progress in the master channel, code completion is better now, yet not
perfect.
when viewing code suggestions, now I see the appropriate values:
[image: image]
<https://user-images.githubusercontent.com/44902066/113343527-c9286a80-92e4-11eb-8e5c-d61e6db59214.png>
a small and minor problem, if the suggested value was a function call, for
example:
[image: image]
<https://user-images.githubusercontent.com/44902066/113343709-068cf800-92e5-11eb-8c9c-bdc49a44ca43.png>
[image: image]
<https://user-images.githubusercontent.com/44902066/113343743-11e02380-92e5-11eb-9f68-801b223f13f9.png>
it completes it as an Enum or a Type, not a function call like this:
[image: image]
<https://user-images.githubusercontent.com/44902066/113344518-050fff80-92e6-11eb-85ab-31bba6d01c59.png>
[image: image]
<https://user-images.githubusercontent.com/44902066/113344537-0b05e080-92e6-11eb-9af1-8a901fd90cf8.png>
Flutter version: 2.1.0-13.0.pre.390
Dart version: 2.13.0 (build 2.13.0-190.0.dev)
Flutter extension version: 3.21.0
dart settings:
"dart.previewLsp": true,
"dart.autoImportCompletions": false
finally, I can upgrade from Flutter 1.20.4 😂.
thank you guys, I hope it will get better and better.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#38739 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIRXJSFCCNJIMWPKFVC6NHDTGTC5NANCNFSM4I6HHMCQ>
.
|
if u goto flutter master channel things do get better just try it |
can u post the full settings.json ? |
Yes, you can do that. what about flutter 2.3?
…On Mon, May 10, 2021 at 8:14 PM Rajesh Kumar ***@***.***> wrote:
new progress in the master channel, code completion is better now, yet not
perfect.
when viewing code suggestions, now I see the appropriate values:
[image: image]
<https://user-images.githubusercontent.com/44902066/113343527-c9286a80-92e4-11eb-8e5c-d61e6db59214.png>
a small and minor problem, if the suggested value was a function call, for
example:
[image: image]
<https://user-images.githubusercontent.com/44902066/113343709-068cf800-92e5-11eb-8c9c-bdc49a44ca43.png>
[image: image]
<https://user-images.githubusercontent.com/44902066/113343743-11e02380-92e5-11eb-9f68-801b223f13f9.png>
it completes it as an Enum or a Type, not a function call like this:
[image: image]
<https://user-images.githubusercontent.com/44902066/113344518-050fff80-92e6-11eb-85ab-31bba6d01c59.png>
[image: image]
<https://user-images.githubusercontent.com/44902066/113344537-0b05e080-92e6-11eb-9af1-8a901fd90cf8.png>
Flutter version: 2.1.0-13.0.pre.390
Dart version: 2.13.0 (build 2.13.0-190.0.dev)
Flutter extension version: 3.21.0
dart settings:
"dart.previewLsp": true,
"dart.autoImportCompletions": false
finally, I can upgrade from Flutter 1.20.4 😂.
thank you guys, I hope it will get better and better.
can u post the full settings.json ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#38739 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIRXJSE66KW4TTTXFRNQBB3TM7Z3VANCNFSM4I6HHMCQ>
.
|
@bwilkerson did you do work on this recently? |
Yes. We're no longer using available suggestions data for libraries that are explicitly imported by the library in which completion is occurring. We are still using it for libraries that could be imported but aren't yet. The recent work should improve the situation but doesn't necessarily solve the whole problem. |
Thanks
…On Thu, May 27, 2021 at 1:30 AM Brian Wilkerson ***@***.***> wrote:
Yes. We're no longer using available suggestions data for libraries that
are explicitly imported by the library in which completion is occurring. We
*are* still using it for libraries that could be imported but aren't yet.
The recent work should improve the situation but doesn't necessarily solve
the whole problem.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#38739 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIRXJSHXG36OZP4Z7RZZJQTTPVK5BANCNFSM4I6HHMCQ>
.
|
Thanks, I'll take a look.
…On Fri, Jun 18, 2021 at 1:27 PM dipeshkd ***@***.***> wrote:
Updated the dart settings as per below and it improved the code
competition suggestion
"dart.previewLsp": true,
"dart.autoImportCompletions": false
However it seems to have broken the package "Auto Import" suggestion
After Applying the change
[image: image]
<https://user-images.githubusercontent.com/9581711/122531031-38576480-d073-11eb-9239-55677cf1f5ae.png>
Before applying the change
[image: image]
<https://user-images.githubusercontent.com/9581711/122531095-47d6ad80-d073-11eb-9023-ab8482add801.png>
Flutter 2.2.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision d79295af24 (7 days ago) • 2021-06-11 08:56:01 -0700
Engine • revision 91c9fc8fe0
Tools • Dart 2.13.3
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#38739 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIRXJSFJAV53P5M6HXII3ETTTL7PPANCNFSM4I6HHMCQ>
.
|
Any news on working fix for IntelliJ also? |
@scheglov Is experimenting with some changes that ought to improve code completion response time on IntelliJ, and this might have also have some benefits in terms of the ranking. Given the end-of-year holidays it isn't clear when we'll have those results, but we are continuing to work on improving code completion. |
The original example at the top is now much better (at least in Flutter |
I believe this issue is redundant now, as we don't use suggestion sets at all. Not-yet-imported completions are included (and ranked) using the same mechanism as other completions now. |
This was raised in Dart-Code, but I think needs to be fixed in the server. I thought there was already an open issue about this here but cannot locate it. I don't know if it's easily fixable, but seems like we should have an issue tracking it here.
This is what completion looked like before:
And this is what it looks like using the new auto-import completions:
Based on comments from @scheglov I think the issue here is that the declared type of the property does not match the one the user wants (because it just uses the parsed AST) and therefore doesn't get ranked at the top.
The text was updated successfully, but these errors were encountered: