You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JavaScript suggestions are currently too intrusive #26340
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.
Mohamed Hegazy (@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?
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?
Activity
nickyhajal commentedon May 10, 2017
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.
seanmcbreen commentedon May 10, 2017
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.
arackaf commentedon May 10, 2017
Whoa - that's 99% of what I need. Thanks a ton Sean McBreen (@seanmcbreen)
mjbvz commentedon May 10, 2017
Mohamed Hegazy (@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:
Promiseare of kindinterfacebut also have an instance. We cannot differentiate completions for pure interface types from those likePromise.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?
mhegazy commentedon May 10, 2017
Filtering should be done on the TS side of things. We should be able to filter compleations based on what the location allow.
mhegazy commentedon May 10, 2017
Matt Bierner (@mjbvz) can you please port this to the TS repo?
mjbvz commentedon May 10, 2017
Opened microsoft/TypeScript#15750 to track reducing the number of type suggestions in js files
Closing as upstream
arackaf commentedon May 10, 2017
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?