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

Typescript: import autocomplete fills in function arguments #2092

Closed
andy-hanson opened this issue Jan 18, 2016 · 6 comments · Fixed by #16415
Closed

Typescript: import autocomplete fills in function arguments #2092

andy-hanson opened this issue Jan 18, 2016 · 6 comments · Fixed by #16415
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug typescript Typescript support issues verified Verification succeeded
Milestone

Comments

@andy-hanson
Copy link

When I use autocomplete to import a function, it fills in the function arguments right there.

Here's what it looks like:

  • import {foo} from './fooBar'
  • import {foo, b} from './fooBar'
  • bar shows up as a suggesstion; hit enter.
  • It fills in as import {foo, bar(argname)} from './fooBar'.
@jrieken jrieken assigned dbaeumer and unassigned jrieken Jan 19, 2016
@dbaeumer
Copy link
Member

@andy-hanson I assume you have set "typescript.useCodeSnippetsOnMethodSuggest": true. Right?

@dbaeumer dbaeumer added typescript Typescript support issues bug Issue identified by VS Code Team member as probable bug labels Jan 20, 2016
@dbaeumer dbaeumer added this to the Backlog milestone Jan 20, 2016
@andy-hanson
Copy link
Author

Right.

@mjbvz
Copy link
Collaborator

mjbvz commented Dec 2, 2016

Quick note: this is not limited to imports, any assignment can be impacted:

const a = {
    func(x) {}
}

let {f|} = a;

completes to

let {func(x)} = a;

mjbvz added a commit to mjbvz/vscode that referenced this issue Dec 3, 2016
Issue microsoft#2092

**bug**
With typescript.useCodeSnippetsOnMethodSuggest enabled, we will automatically complete function calls inside some contexts where they should not be completed. For example,  destructing assigment.

**fix**
Add a quickinfo check on the position before attempting to insert a function call. Create a blacklist of invalid contexts. Otherwise, assume that we want to complete the function call.
@mjbvz mjbvz modified the milestones: January 2017, Backlog Dec 9, 2016
mjbvz added a commit that referenced this issue Dec 12, 2016
…ts (#16415)

Issue #2092

**bug**
With typescript.useCodeSnippetsOnMethodSuggest enabled, we will automatically complete function calls inside some contexts where they should not be completed. For example,  destructing assigment.

**fix**
Add a quickinfo check on the position before attempting to insert a function call. Create a blacklist of invalid contexts. Otherwise, assume that we want to complete the function call.
@zakdances
Copy link

I'm still getting this error. The autocomplete just fills in an argument's type, not a correct signature.

@mjbvz
Copy link
Collaborator

mjbvz commented Dec 19, 2016

@zakdances Are you on 1.9 insiders? This fix is not in VSCode 1.8.

@zakdances
Copy link

@mjbvz I'm using 1.8.1 so I guess you can disregard my message. Thanks for the heads up!

@alexdima alexdima added the verified Verification succeeded label Jan 27, 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
bug Issue identified by VS Code Team member as probable bug typescript Typescript support issues verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants