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

Intellisense's 'Suggest selection' should keep working when you have typed something #66019

Open
natanfudge opened this issue Jan 4, 2019 · 3 comments
Assignees
Labels
feature-request Request for new features or functionality suggest IntelliSense, Auto Complete under-discussion Issue is under discussion for relevance, priority, approach
Milestone

Comments

@natanfudge
Copy link

VSCode has a feature that remembers recent completions the user has selected and then automatically choosen those completions for them the next time.
The problem is that it behaves quite oddly, and here is an example that illustrates why:

  • Create a new Typescript file.
  • Type console. vscode will suggest all of the available methods of console.
  • Choose exception.
  • Type console. again. Vscode will immediately suggest exception, as expected.
    And now here is the weird part: Type e, and instead of still suggesting exception, it will suggest error!

The problem here is that once you type anything after the suggestion came, vscode will completely disregard your completion history and will just give you the best match lexicographically. Even if in the example you have completed exception by typing an e and then having it complete it, the same thing will occur.
My suggestion is that when you have already typed something, the 'suggest selection' will just be filtered by what you have typed, instead of stop working. So in the example, after you have typed e, it will still suggest exception.

"Switch the Suggest Selection settings to "recentlyUsedByPrefix" and it will work!"
Yes it does make it sometimes work but overall it makes the situation much worse. For example if you type just console. it won't suggest exception no matter what you have done before.

@jrieken jrieken added the under-discussion Issue is under discussion for relevance, priority, approach label Jan 7, 2019
@jrieken
Copy link
Member

jrieken commented Jan 7, 2019

Yes - that's the designed and documented behaviour, e.g "Select recent suggestions unless further typing selects one, e.g. console.| -> console.log because log has been completed recently.")" and "Select suggestions based on previous prefixes that have completed those suggestions, e.g. co -> console and con -> const.")". We started this feature with a more sticky variant but good very negative feedback as it would prevent you fro selecting any other suggestion.

E.g. with console and exception what would you expected when typing l, log or still exception?

@jrieken jrieken added the suggest IntelliSense, Auto Complete label Jan 7, 2019
@natanfudge
Copy link
Author

Thanks for the response jrieken.
When typing l, I would have expected it to complete log because exception has already been filtered out. On the other hand, when I type e It's pretty obvious I want to type exception again, since exception starts with e. Although when I type er, exception should absolutely not be an option, and error should again be the dominant suggestion.

Another possible scenario is this: I first type console. and complete to time. After this, when I type console.i, technically time was not filtered out. Here there are two options: we either give time priority since it was typed before and not filtered, or we give info priority since it matches better. Here I could see why you would give info priority since it's a stretch to say that when I type i I mean to type time.
Although, in the example I showed (with the error/exception), exception is a very good match, and so should definitely should still be suggested, and not error.

So to sum up my opinion:

  • When there is a very good match (for example e->exception) the suggestion should definitely keep suggestion the same thing (exception in the example).
  • When there is no match (for example l->exception) the suggestion should definitely be ignored (so complete to log).
  • When it matches but not perfectly (for example i->time), suggesting time is debatable, and I'm leaning towards yes, but I can see why that would seem like "you can't type anything else".

@jrieken
Copy link
Member

jrieken commented Jan 7, 2019

Ok, that's kind of what it does today "Select recent suggestions unless further typing selects one". The thing is that e and error or e and exception score equally well and that then the original order (alphabetical) is used to make a decision. I can check if we can use the history instead.

@jrieken jrieken added the feature-request Request for new features or functionality label Jan 7, 2019
@jrieken jrieken added this to the Backlog milestone Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality suggest IntelliSense, Auto Complete under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests

2 participants