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

Emmet suggestion not appearing at the top of the list in jsx files #39518

Closed
rajinder-yadav opened this issue Dec 4, 2017 · 10 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug suggest IntelliSense, Auto Complete verified Verification succeeded
Milestone

Comments

@rajinder-yadav
Copy link

  • VSCode Version: Code - Insiders 1.19.0-insider (5b0fa2e, 2017-12-01T06:07:42.474Z)
  • OS Version: Darwin x64 17.2.0
  • Extensions:
Extension Author (truncated) Version
markdown-toc Ala 1.5.6
vscode-markdownlint Dav 0.12.0
EditorConfig Edi 0.11.1
vscode-eslint dba 1.4.3
tslint eg2 1.0.24
cpptools ms- 0.14.3
debugger-for-chrome msj 3.5.0
autoimport ste 1.5.3
vim vsc 0.10.5
markdown-pdf yza 0.1.7

(2 theme extensions excluded)

When I type form and hit tab, I expect it to get emmet to expand it to the

tags. Instead it is replaced with the word "from".

I have notice this happens with other tags and emmet expansion is unreliable for one off keywords. It would be nice to switch the behaviour for emmet to kick in with hitting tab 2 times really quickly, so intellisense don't do the wrong thing.


Steps to Reproduce:

  1. in a .jsx file type 'form'
  2. hit tab for emmet expansion
  3. form is replaced with from

screen shot 2017-12-03 at 8 53 26 pm 2

Reproduces without extensions: Yes/No

@vscodebot vscodebot bot added the insiders label Dec 4, 2017
@vscodebot vscodebot bot added the emmet Emmet related issues label Dec 4, 2017
@rajinder-yadav
Copy link
Author

Even if I hit escape to dismiss intellisense, then hit tab, emmet expansion doesn't kick in.

@rajinder-yadav
Copy link
Author

Also I should always be able to type a html tag, or user defined react, angular tag, like "<from" hit tab and emmet should know what to do when fail on a keyword!

@ramya-rao-a
Copy link
Contributor

Where is this from keyword coming from? I can't get a repro. If I can repro this, I can look into why the from is sorted higher compared to form.

You can also add the below 2 settings to ensure emmet suggestions always appear on top

 "emmet.showSuggestionsAsSnippets": true,
    "editor.snippetSuggestions": "top"

Even if I hit escape to dismiss intellisense, then hit tab, emmet expansion doesn't kick in.

Emmet expansion on tab in the absence of intellisense occurs only if you have added the setting "emmet.triggerExpansionOnTab": true

@ramya-rao-a ramya-rao-a added the info-needed Issue requires more information from poster label Dec 4, 2017
@ramya-rao-a ramya-rao-a changed the title Emmet expansion failing Emmet suggestion not appearing at the top of the list in jsx files Dec 4, 2017
@rajinder-yadav
Copy link
Author

No idea where from is coming from and why?
Try creating a simple react.js app, then create a new component file with a .jsx extension to enable emmet for this file. If you're not sure how to do this, just ask me to create a simple project you can fetch from github.

@rajinder-yadav
Copy link
Author

Also thanks for the setting suggestions, I added, "emmet.triggerExpansionOnTab": true but don't want to use the other for now.

@rajinder-yadav
Copy link
Author

rajinder-yadav commented Dec 4, 2017

FYI: I did try all 3 settings you suggested and still from get selected even though it's not the top item.

emmet-bug2

@ramya-rao-a
Copy link
Contributor

Please share a sample project where I can try and get a repro.

Also, try running code --disable-extensions and see if you still see the from. That will tell us if the suggestion is coming from one of your installed extensions

@rajinder-yadav
Copy link
Author

rajinder-yadav commented Dec 5, 2017

Using --disable-extensions still shows the bug for me, as well as "from".

  1. Please make sure you remove those 3 vscode settings you shared earlier when investigating.
  2. Here is the demo app: https://github.com/rajinder-yadav/demo_app
  3. Open file src/containers/user-form.jsx, inside the render function, type, "form", you should see the bug. GL :)

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Dec 5, 2017

Thanks for the sample code @rajinder-yadav, I can repro it now.
My mistake, I was trying to repro in stable, whereas this issue only appears in Insiders
The root cause is the we recently implemented a feature request #15419 that accommodate typos.

@jrieken Here is a case where relaxing for typos is counter productive. In this case both form and from get the same score. Shouldnt the non typo match be scored higher than the one for the typo?

Repro steps: Using Insiders, type form in any jsx file. from is preselected instead of form

Linking this to #39550

@ramya-rao-a ramya-rao-a added suggest IntelliSense, Auto Complete and removed emmet Emmet related issues info-needed Issue requires more information from poster labels Dec 5, 2017
@ramya-rao-a ramya-rao-a added the bug Issue identified by VS Code Team member as probable bug label Dec 5, 2017
@jrieken jrieken added this to the November 2017 milestone Dec 6, 2017
@jrieken
Copy link
Member

jrieken commented Dec 6, 2017

I see... I will penalize permutation matches which should make this better. Still, it is fuzzy by its nature

@jrieken jrieken closed this as completed in 45520c6 Dec 6, 2017
@mjbvz mjbvz added the verified Verification succeeded label Dec 6, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 20, 2018
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 suggest IntelliSense, Auto Complete verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants