Vscode: JavaScript suggestions are currently too intrusive

Created on 10 May 2017  路  8Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.12.1
  • OS Version: Windows 10

Steps to Reproduce:

  1. Type anything - the suggestions that come up may be filtered poorly, and block out desired snippets added by extensions

Related to this Stack Overflow question: http://stackoverflow.com/questions/43850267/configure-visual-studio-code-suggestions/

It would be ideal to be able to see all sources for these suggestions, and be able to turn them off. Or any other workarounds would be much appreciated too! I selected the highlighted option in the image and tried to "go to definition" but none was found, so it appears to be really tricky tracking down the .d.ts file where these are coming from.

image

feature-request javascript upstream

Most helpful comment

One option we have in the interim is to add this setting to your settings:

"editor.snippetSuggestions": "top"

That will place snippet suggestions higher in the sort order.

All 8 comments

VSCode Version: 1.12.1
OS Version: macOS 10.12.3

I am experiencing this as well. As you can see, I have a perfect match with a snippet typed in the screenshot below but it's still not selected.

segmentedbutton_js_-_client

One option we have in the interim is to add this setting to your settings:

"editor.snippetSuggestions": "top"

That will place snippet suggestions higher in the sort order.

Whoa - that's 99% of what I need. Thanks a ton @seanmcbreen

@mhegazy We've seen a few requests similar to this about reducing the number of completions in JavaScript contexts. I prototyped a simple filter, but there are a few complications:

  • The interface and type completion items are usually not helpful in regular JavaScript code, but they may be needed in JSDoc comments.
  • Completion items for some types such as Promise are of kind interface but also have an instance. We cannot differentiate completions for pure interface types from those like Promise.

We should be able to workaround the first issue on the VSCode side but the second would require a TS change. There may be other problems that I haven't considered here. Any thoughts on this?

Filtering should be done on the TS side of things. We should be able to filter compleations based on what the location allow.

@mjbvz can you please port this to the TS repo?

Opened https://github.com/Microsoft/TypeScript/issues/15750 to track reducing the number of type suggestions in js files

Closing as upstream

Fair enough - are you sure this couldn't be solved more easily in VS Code though? Ie, just expose all the sources of these suggestions and let users blacklist as many or as few as desired?

Was this page helpful?
0 / 5 - 0 ratings