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

Autocomplete for "console.log()" in JavaScript and TypeScript is wrong. #9072

Closed
VladimirAmiorkov opened this issue Jul 11, 2016 · 12 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug *duplicate Issue identified as a duplicate of another issue(s)
Milestone

Comments

@VladimirAmiorkov
Copy link

  • VSCode Version: 1.3.0 (1.3.0)
  • OS Version: OS X 10.11.5 (15F34)

Steps to Reproduce:

  1. type console.l
  2. Press tab to autocomplete
  3. the result is "console.console.log();"

It looks like not the method "log" is autocompleted but the entire class + function.

@weinand weinand added the bug Issue identified by VS Code Team member as probable bug label Jul 11, 2016
@dbaeumer
Copy link
Member

@VladimirAmiorkov do you have an extension installed that adds snippets. Looks like you selected a snippet. I can't reproduce this using 1.3.0

cast

@dbaeumer
Copy link
Member

Please ping if you see this on a vanilla VSCode install. A test project showing the error would be helpful

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Jul 12, 2016
@VladimirAmiorkov
Copy link
Author

VladimirAmiorkov commented Jul 12, 2016

Hi @dbaeumer ,

I can confirm that without any extensions I can reproduce this issue in a TypeScript file (.ts) in JavaScript it seams to be ok after removing 3 extensions (TypeScript extension, Angular 2 and NativeScript). But the fact that it was ok for both TypeScript and JavaScript with those 3 extension before upgrading to the latest version is troubling.

jul-12-2016 10-42-21

@dbaeumer dbaeumer assigned jrieken and unassigned dbaeumer Jul 13, 2016
@dbaeumer dbaeumer removed the info-needed Issue requires more information from poster label Jul 13, 2016
@dbaeumer
Copy link
Member

@jrieken assigning to you since this is not caused by TS/JS. Looks like that an extensions adds a snippet and the snippet now wins over the TS proposal.

@jrieken jrieken removed their assignment Jul 13, 2016
@jrieken
Copy link
Member

jrieken commented Jul 13, 2016

I do not own snippets

@dbaeumer
Copy link
Member

As I understand the issue the user has an extension which snippets win over TS/JS proposal. Did something change in regards of sorting/priority. It seemed to work for 1.2.x

@jrieken jrieken removed their assignment Jul 13, 2016
@jrieken
Copy link
Member

jrieken commented Jul 13, 2016

@dbaeumer No - this is because TypeScript ships with a console.log snippet

@dbaeumer
Copy link
Member

dbaeumer commented Jul 13, 2016

@jrieken yes I know, but we always did. @VladimirAmiorkov pointed out this happened after upgrading to 1.3.0 (see #9072 (comment))

For JS his problem disappeared after uninstalling the extensions. Interestingly we don't ship with a log snippet for JS. This is why I ask you whether something has changed in the code to pick the first match.

For TS this is a very strange behavior and I don't know whether its is you or @joaomoreno. See the screen cast. When you first type the 'l' the log method is selected when you go back the snippet is selected. This is with VSCode 1.2.1

cast

And this is with 1.3.x

cast

@jrieken
Copy link
Member

jrieken commented Jul 13, 2016

@aeschli owns the SnippetRegistry which is responsible for inserting snippet completions

@aeschli
Copy link
Contributor

aeschli commented Jul 13, 2016

The problem is IMO not that the snippet proposal appears: Its name prefix-matches the current word, that's why it appears. The problem is that it get's ranked before any of the language proposals in particular the log proposal.
Either we improve the sort order or we remove snippet proposals from the the code completion list and put them on a separate key.

@egamma egamma mentioned this issue Jul 14, 2016
89 tasks
@egamma egamma added this to the July 2016 milestone Jul 14, 2016
@jrieken jrieken added the *duplicate Issue identified as a duplicate of another issue(s) label Jul 14, 2016
@jrieken
Copy link
Member

jrieken commented Jul 14, 2016

closing as duplicate of #9286

@masaeedu
Copy link

@jrieken #9286 is a feature request, this is a bug. Is this bug fixed, or is there a workaround enabled by #9286?

@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 *duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

7 participants