Skip to content

TypeScript (and emmet) suggestions show up in the wrong order #145877

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

Closed
jasonwilliams opened this issue Mar 23, 2022 · 7 comments
Closed

TypeScript (and emmet) suggestions show up in the wrong order #145877

jasonwilliams opened this issue Mar 23, 2022 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug javascript JavaScript support issues suggest IntelliSense, Auto Complete typescript Typescript support issues
Milestone

Comments

@jasonwilliams
Copy link
Contributor

Does this issue occur when all extensions are disabled?: Yes/No

Version: 1.65.2
Commit: c722ca6
Date: 2022-03-10T14:33:49.188Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 20.6.0

When using import statement completions the suggestions which come back are not always in a great order, meaning I need to cycle down a couple of times until i get what I need. This makes the development process a bit degraded compared to others IDEs.

An example is this:
Screenshot 2022-03-23 at 10 44 00

In the image above, i want ContentType but the suggestions I get back are ContentTypeHeaderStories and an emmet suggestion. The one i want is on the 3rd row down.

I don't want to swtich emmet off but I don't think emmet should be prioritised so high above TypeScript suggestions, especially when (in this case) it's being used as a "catch all".

Secondly (and this may be more for @andrewbranch) I would expect the default export ContentTypeHeaderStories to be below ContentType and only be higher when I type ContentTypeH...

Steps to Reproduce:

  1. Clone https://github.com/jasonwilliams/autocomplete-testcase
  2. follow steps in readme
@mjbvz
Copy link
Collaborator

mjbvz commented Mar 29, 2022

Thanks for the repo @jasonwilliams!

@jrieken I believe the suggestions are sorted like this due to the prefix match. contentTypeHeaderStories has an insert text of import contentTypeHeaderStories ... so it matches the text already on the line

However for ContentType, the insert text is import { ContentType } which does not match the existing text as well

This behavior makes sense once I understood it but feels confusing as a user. Any ideas on how we can work around this?

@jrieken
Copy link
Member

jrieken commented Mar 30, 2022

The insert text doesn't matter but the filter text does. Emmet is using the line text as filter text and therefore matches fairly strong. You can see scores when pressing cmd+/ while IntelliSense shows:

prefix is the text value that's selected with the completion items range, word is the filterText
Screenshot 2022-03-30 at 09 11 28
Screenshot 2022-03-30 at 09 11 33
Screenshot 2022-03-30 at 09 11 37

@rzhao271
Copy link
Contributor

rzhao271 commented Apr 5, 2022

Emmet shouldn't be showing up there.
Though I feel that the most thorough fix for Emmet in this case would involve adding on a JSX parser (rather than just an HTML one), I realized the other day that I might be able to reduce the locations where Emmet suggestions show up.
For example, see #146757

@rzhao271 rzhao271 modified the milestones: April 2022, On Deck Apr 22, 2022
@heroboy
Copy link

heroboy commented Apr 28, 2022

I find in recent updated vscode, the emmet suggestion is always on the top.
image

@mjbvz mjbvz added bug Issue identified by VS Code Team member as probable bug typescript Typescript support issues javascript JavaScript support issues suggest IntelliSense, Auto Complete labels May 6, 2022
@jodymgustafson
Copy link

This seems to be getting worse. When I'm creating an object and I want to see what fields are available in the type, they always show at the bottom of the list. So I have to scroll down past a large number of suggestions that don't even make sense in the context. It's very frustrating and annoying.

image

@rzhao271
Copy link
Contributor

@jodymgustafson I think in your case those completions are from another extension, meaning you'll have to file a separate issue at that extension's GitHub repository.

@rzhao271
Copy link
Contributor

I believe the worst offender here is the Emmet suggestion, and will close this issue in favour of the Emmet-specific issue #51537

@rzhao271 rzhao271 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 10, 2024
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jan 24, 2025
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 javascript JavaScript support issues suggest IntelliSense, Auto Complete typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

6 participants