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 duplicate method as property in completion and miss parameters #20865

Closed
DavidBabel opened this issue Feb 18, 2017 · 8 comments
Closed
Assignees
Labels
*caused-by-extension Issue identified to be caused by an extension javascript JavaScript support issues typescript Typescript support issues

Comments

@DavidBabel
Copy link

DavidBabel commented Feb 18, 2017

  • VSCode Version: 1.9.1
  • OS Version: MacOs Sierra 10.12.3
    Tested with no extensions / no personal config.

Steps to Reproduce:

In a javascript file :

  1. type :
//     cursor v
"String".toLow|
  1. press "tab"
  2. give the result :
//           cursor v
"String".toLowerCase|

Expected parenthesis :

//             cursor v
"String".toLowerCase( | )

The problem seems to be intellisense consider all exported functions as property too.
It result in a duplicate suggestion, one good, and the other broken. The problem is that the broken one is considered first.

Here is an example, we can show twice the same completion. The second do the job but the first (default) is crap :
untitled

How can i disable the first or priorize the second ?

@DavidBabel DavidBabel changed the title IntelliSense does not add parenthesis on method completion IntelliSense duplicate method as property in completion and miss parameters Feb 19, 2017
@DavidBabel
Copy link
Author

Another example for setTimeout function :

grrrr

First is awesome, second is totally crap (and is default) and third is just acceptable.

The problem with intellisense here, is that we got no idea where it's from and if it's configurable.

@jrieken
Copy link
Member

jrieken commented Feb 21, 2017

There is this setting "typescript.useCodeSnippetsOnMethodSuggest": false which also works for JavaScript like that. Maybe a bug @mjbvz ?

@DavidBabel
Copy link
Author

DavidBabel commented Feb 21, 2017

Thanks @jrieken , "typescript.useCodeSnippetsOnMethodSuggest": true did the trick.

But a way to configure which intellisense are enabled globally can be very usefull since we never know where a suggestion come from, and regarding the mass of extension adding some.

@mjbvz
Copy link
Collaborator

mjbvz commented Feb 22, 2017

@DavidBabel I'm not sure the suggestion that completes the function call is coming from. @jrieken is correct that "typescript.useCodeSnippetsOnMethodSuggest"" configures the default js/ts suggestions to try to complete function calls, however I only even see one suggestion for methods like read and two suggestions (a property and a snippet) for setTimeout.

Can you please try running code using the --disable-extensions command line flag to ensure this is not coming from an extension?

@mjbvz mjbvz added javascript JavaScript support issues info-needed Issue requires more information from poster typescript Typescript support issues labels Feb 22, 2017
@DavidBabel
Copy link
Author

Actually the problem appear on single suggestion too, without any extension and a config file with only this config : "typescript.useCodeSnippetsOnMethodSuggest" set to true . Here is best example :

requirebug

And I still have two setTimeout suggestion on fresh installed vscode.

@mjbvz You are right, i did not check which extension it is, but i got an extension adding some intellisense for sure.
But the problem is : how disable the default behaviour or choose the priority if an extension add better intellisense ? This will allow to choose better default result and remove duplicates.

@mjbvz
Copy link
Collaborator

mjbvz commented Feb 22, 2017

@DavidBabel #17068 tracks allowing disabling built-in extensions. I believe there's also been discussion of finer grained control to toggle specific features (such as completion items) of each extension, but this is farther off

We expect the two setTimeout definitions since one is a snippet. You can remove snippets from the suggestion list using "editor.snippetSuggestions": "none"

@DavidBabel
Copy link
Author

DavidBabel commented Feb 22, 2017

Yeah but it remove all the snippets. I like my personnal ones :p

Actually i did test thissetTimeout snippet on a new MacOs User session, with no vscode configuration at all, on both vscode 1.9.1 and nightly, and both same result : double suggestion.

If it can help i have a mac touchbar, french keyboard :
image

@mjbvz mjbvz added *caused-by-extension Issue identified to be caused by an extension and removed info-needed Issue requires more information from poster labels Feb 24, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Feb 24, 2017

@DavidBabel This still sounds like the expected behavior. There are a couple of issues tracking the various issues you've noted:

Please follow up with the extension that is providing these additional suggestions to get them to return suggestions that are preferred over the builtin TypeScript suggestions

@mjbvz mjbvz closed this as completed Feb 24, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*caused-by-extension Issue identified to be caused by an extension javascript JavaScript support issues typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

3 participants