Vscode: Intellisense suggestions are awful. Unintuitive ordering, poor completions, and tons of irrelevant snippets.

Created on 24 Dec 2016  路  14Comments  路  Source: microsoft/vscode

  • VSCode Version:
    1.8.1

  • OS Version:
    MacOS Sierra

Steps to Reproduce:

I've been frustrated with VSCode's suggestions for a while now, but I've been assuming it was my own ignorance of the feature. After reading the docs, however, I still don't understand why my suggestions are so awful.

For example, in my TypeScript files I have MANY instances of the word this but when I type t the highlighted suggestion is to despite the fact that to is used absolutely nowhere in my file. I have many instances of console.log but I have to type conso to even get a console suggestion and even then it NEVER offers the appropriate console.log as a snippet. When I type log I get a log() function snippet despite no usage of that function by itself.

I type c and the highlighted suggestion is col for no apparent reason. Again, I have zero instances of col. If I type con why is stuff like ConstrainDOMString (which I don't use) prioritized before console.log?

I type a and I see obscure terms like AssignedNodesOptions but no Array! I have to scroll the suggestion list to see Array.

You're probably getting the picture now. There's so many irrelevant completions and snippets that popup that I often just manually type my variable names. Intellisense feels broken like it's not intelligently doing anything but a simply context-free dictionary lookup. Sublime Text 3 had better "intellisense".

Here's a simplified example of this issue:
no intellissnse

col is NOT an intelligent suggestion in that context.

*duplicate typescript

Most helpful comment

Actually, now that you have mentioned the command panel bug, it happens in the file picker (Ctrl+P) too:

Working with react, I have most of my files organized as:

+ ComponentName/
|__ index.js
|__ ComponentName.js
|__ ComponentName.css

But, when I type a component name, say Icons, it does match the two files exactly named Icons, but after that, it doesn't have the Icons/index.js even in first 20 results. When I type Icons/, then things improve a little but, but still not what I would expect. See the results below:

image

I think the ranking algorithm should be adjusted to give more weightage to longer runs of matching text.

For reference, this is what sublime does (see the score beside the name)
image

All 14 comments

While using Flow, many times, the intellisense dropdown has random words1 focussed instead of types, even though the types and function names come on the top of the list, the focussed word is somewhere in the middle of the list, and almost never right. I end up typing the whole word 90% of the time.

image


1words: denotes words in code which are neither types nor literals, just strings

This is helpful feedback. Thank you for opening this issue.

And intellisense doesn't just fail when it comes to an open document - it also fails with the command panel:

screen shot

I've used Extensions: Install Extensions many times. I've used Extensions: Disable All Installed Extensions exactly 0 times. And yet VSCode has chosen the latter as it's default highlighted suggestion. Why?

Actually, now that you have mentioned the command panel bug, it happens in the file picker (Ctrl+P) too:

Working with react, I have most of my files organized as:

+ ComponentName/
|__ index.js
|__ ComponentName.js
|__ ComponentName.css

But, when I type a component name, say Icons, it does match the two files exactly named Icons, but after that, it doesn't have the Icons/index.js even in first 20 results. When I type Icons/, then things improve a little but, but still not what I would expect. See the results below:

image

I think the ranking algorithm should be adjusted to give more weightage to longer runs of matching text.

For reference, this is what sublime does (see the score beside the name)
image

As a Sublime user trying out VS Code, this issue alone will keep me from switching.

Is there any plan to solve this issue?

Huge +1.
My biggest issue is that when constructing an object of a known type (typescript), and attempting to get a suggestion for its property, the suggestions does not show the type's properties on top, but rather mixed up with other things making you hunt for these based on icon. Just fixing this ordering issue would improve usability tremendously.
vsc - suggestions issue

Adding @jrieken since he looked into improving suggestion ordering with #22153. As far as I can tell, the TypeScript extension does provide correctly ordered results in many of these cases, but once filtering kicks in, we sometimes end up showing items that were originally weighted lower first in the list

I believe that @bpasero has also been investigating improving file quick open filtering with #21019, #12095, and #17443

Problem is like this: Suggestions can come from multiple providers that don't know each other. The consequence is that there is no way a local sort order from one provider applies globally.

Because of that we sort alphabetically when no filter text is given (the text left of the cursor). As soon as something is being typed we sort/filter completions based on how well they match against the text left of the cursor. The latter part is new and will ship with the April release (https://github.com/Microsoft/vscode/issues/23643). Try it out in insiders today. The behaviour should be very sublime-fuzzy-like.

apr-12-2017 09-37-04

col is NOT an intelligent suggestion in that context.

@zakdances Yes, it's a snippet and there is a setting to not show snippet in IntelliSense: "editor.snippetSuggestions": "none"

Ok, closing as a duplicate of those issues. Please give the latest VSCode insiders a try and let us know how the new suggestion ordering works


It looks better in VSCode insiders. Can't wait for the next update.

Totally agree with this. It should be possible to order / group the suggestions and make it more context aware and more. A list of ideas:

  • Group suggestions
  • Order index of suggestion
  • Order importance (very important, important, normal etc.)

    • Custom configurable

    • Based of usage of the term in current file

    • Prebuilt average importance map

etc.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

philipgiuliani picture philipgiuliani  路  3Comments

sirius1024 picture sirius1024  路  3Comments

lukehoban picture lukehoban  路  3Comments

DovydasNavickas picture DovydasNavickas  路  3Comments

shanalikhan picture shanalikhan  路  3Comments