-
Notifications
You must be signed in to change notification settings - Fork 70
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
[VS Code] JS/TS always selects the first suggestion #53
Comments
I believe the first issue is by design, since the IntelliCode extension moves the recommended items to the top of the completion list, and by default it selects the most-likely recommendation. In many cases (but not all), the most likely recommendation does match the recently used member. I can also reproduce the issue with IntelliSense popping up inside the string literal, but only when coming back to it after completing the statement. When typing it out initially, IntelliSense does not pop up. Thanks for reporting this bug. /cc @minestarks |
No problem. I actually like As I understand this extension suggests you the most used ones instead of recently. Also, sometimes I get this: As you can see * suggestions is not at the top. |
@jkeech who should "win" in this case? IntelliCode or VS Code? They're both doing their best to push most relevant suggestions to the top 😄 (Even if the answer is ideally IntelliCode, I'm actually not sure if a plugin like IntelliCode can override the final sorting done by VS Code.) @svipben Do you have an example for the behavior in your original description, i.e. where IntelliCode appears to override/disable the |
@minestarks, I would expect IntelliCode suggestions to show up at the top if the extension is enabled and it offers suggestions. Do you know why the IntelliCode suggestions are normally sorted at the top, but in this case, VS Code pushed two suggestions higher? @svipben, the extension recommends the most likely (popular) suggestion based on the current context. Since the context continually changes as you type, the suggestions can adapt. So for instance, if you are repeating the same member multiple times, and if that pattern is common among other codebases, then IntelliCode would also recommend that pattern in your case. For example, if you start typing in a function without much context, IntelliCode might recommend one thing, but you choose a different path. It then adapts and recommends the next likely thing based on what you have done so far, even though it was different than the initial suggestion. It doesn't necessarily recommend the exact same members every time. Here's an example showing what I mean. Notice how the recommendations change as I go: |
@minestarks +1 to what @jkeech says: keeping the starred IntelliCode suggestions always at the top means they are a clear group to be picked from, then the regular list cuts in. In this way it's easy to skip straight to the list if IC doesn't have what you want, and the regular list feels like it always did. |
Sorry for creating 3 issues in one. I separated |
@svipben oh thanks, that's really helpful. So this one is just tracking the fact that IntelliCode appears to disable/ignore the |
@minestarks Yeah, it looks like it doesn't work at all with IntelliCode. But I think you should carefully think of So long story short: |
Yes, the IntelliCode extension declares You can override the setting by specifying a language-specific override setting for "[javascript]": {
"editor.suggestSelection": "recentlyUsedByPrefix"
},
"[typescript]": {
"editor.suggestSelection": "recentlyUsedByPrefix"
},
"[java]": {
"editor.suggestSelection": "recentlyUsedByPrefix"
},
"[python]": {
"editor.suggestSelection": "recentlyUsedByPrefix"
} |
@vivlimmsft you're right, with this configuration it works. I understand why you kept {
"vsintellicode.suggestSelection": {
"type": "string",
"enum": [
"first",
"recentlyUsed",
"recentlyUsedByPrefix"
],
"default": "first",
"description": "Controls how suggestions are pre-selected when showing the suggest list."
}
} Then user can decide which one is better for him. And as you can see default will be still |
Guys any news on this? I'm not pushing you though, but I'm interested if you're thinking about my suggestion to introduce that setting mentioned above. Thanks! |
Hey @svipben, yes, we are planning on improving this scenario soon. We discussed the options offline the other day and came up with this solution:
The reason we have to continue using the editor setting instead of a special vsintellicode setting is because the behavior change is controlled by the editor itself -- it's not something that IntelliCode can alter when providing completions. It's just that some combinations of that setting are incompatible with IntelliCode, so we try to fix that issue. But we can detect if you had a different (compatible) setting in place and try to make sure the IntelliCode defaults honor that setting and give you the choice on how to proceed. The end state is that if you had an incompatible setting, we automatically change it to be compatible. If you had a different compatible setting, we will help you configure IntelliCode to keep that setting in place. A different way we might implement this is to remove all of the default settings in IntelliCode, and then at activation, detect if you are using an incompatible setting, and if so, only then set the specific override to a compatible setting. This would avoid the separate notification when you are on an existing compatible setting that is different than "first". |
@jkeech Thanks for response, so in all scenarios it would add these in my settings? "[javascript]": {
"editor.suggestSelection": "recentlyUsedByPrefix"
},
"[typescript]": {
"editor.suggestSelection": "recentlyUsedByPrefix"
},
"[java]": {
"editor.suggestSelection": "recentlyUsedByPrefix"
},
"[python]": {
"editor.suggestSelection": "recentlyUsedByPrefix"
} |
In the last scenario, it wouldn’t override your settings at all because you are already using a compatible setting at the global level. |
I like the last scenario then. It checks if it's |
Also, you should consider this situation: "editor.tabCompletion": "on",
"editor.quickSuggestions": false, In this situation, it should respect whatever |
I think the general principle should be that we do not alter when the completion list shows up, but when it does show up, we ensure that the IntelliCode suggestions are the top/default options if you have the IntelliCode extension enabled. In the scenario where you want different completion list sorting behavior that is conditioned on whether the list is visible or not -- I don't think this is possible without a VS code editor change. The sorting is something that the editor itself is doing, and as far as I know, it's not configurable based on when the completion list is being invoked, other than the per-language overrides. I think you have to pick one setting or the other, and it applies equally whether or not the list is visible. So in this case, it would still have to be Even if it was possible to conditionally change the sorting based on completion list visibility, I'm not sure that it's the best approach. The overall idea is that, on average, the top IntelliCode suggestion should be more accurate than the top |
@jkeech Sounds good, waiting for an update then! Thank you 🔥 |
We found out that extensions cannot programmatically set language-specific setting overrides using the VS Code APIs, so we are going to change the implementation slightly. The end result should be the same for you though -- if you have Here's the new logic, which should be available soon in the next update of the extension (1.1.4):
"configurationDefaults": {
"editor.suggestSelection": "first"
},
|
We changed the implementation from what @jkeech mentioned above, because we found that configurationDefaults declared in The new implementation, which is in 1.1.4, removes all defaults from our
We introduced a new setting,
To opt out of this behavior, you can add If you still want to use "[csharp]": {
"editor.suggestSelection": "recentlyUsed"
}, |
Thanks, guys for the update. I'm really happy with these changes and I understand the reason. Good job! |
Version 1.1.4 has been published to the marketplace. Please give it a shot and let us know what you think. Thanks! |
Product and Version [VS/VSCode]: VS Code
OS Version [macOS/Windows]: macOS 10.14.3
IntelliCode Extension Version: 1.1.2
Target Platform or Language [e.g. Node.js]: JavaScript & TypeScript
Steps to Reproduce / Scenario:
recentlyUsed
ineditor.suggestSelection
which is default in VS Code.first
ineditor.suggestSelection
.I expect this feature to work properly with this extension enabled.
Thank you!
The text was updated successfully, but these errors were encountered: