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 does not work in js/jsx files for VS Code 1.62.2(Universal) #137012

Closed
shiraz opened this issue Nov 12, 2021 · 19 comments
Closed

Emmet does not work in js/jsx files for VS Code 1.62.2(Universal) #137012

shiraz opened this issue Nov 12, 2021 · 19 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member emmet Emmet related issues insiders-released Patch has been released in VS Code Insiders regression Something that used to work is now broken verified Verification succeeded
Milestone

Comments

@shiraz
Copy link

shiraz commented Nov 12, 2021

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

  • VS Code Version: 1.62.2
  • OS Version: macOS 10.15.7

Steps to Reproduce:

  1. Download VS Code v1.62.2 on a Mac.
  2. Create an file in the path pages/index.js.
  3. Create a simple functional component like:
function HomePage(props) {
  return (
    <div>       
        <title>NextJS Events</title>
    </div>
  );
}
  1. Type div.test in the div and press Tab.
  2. Observe that nothing happens.
  3. Disable all extensions.
  4. Restart VS Code.
  5. Observe that the same issue occurs.

Notes:
I added the following code in settings.json and then restarted VS Code. The same issue occurs when I try to use Emmet.

{
   "emmet.includeLanguages": {
      "javascript": "javascriptreact"
    }
}
@rickyalmeidadev
Copy link

I've noticed the same, commenting here to keep up with any updates.

@rzhao271
Copy link
Contributor

Emmet is an extension, so disabling the extensions wouldn't work.
I'm unable to reproduce the issue on 1.62.2 or Insiders (though I'm on macOS 11.6.1), unless you tried passing tab when there weren't any suggestions, in which case the setting emmet.triggerExpansionOnTab needs to be enabled.

@rzhao271
Copy link
Contributor

\gifPlease

@BurnyLlama
Copy link

This is kinda what @shiraz means @rzhao271 :
recording

@BurnyLlama
Copy link

Basically emmet does not include the emmet.includeLanguages...

@BurnyLlama
Copy link

I found a fix!

I could solve this by enabling emmet.triggerExpansionOnTab:

"emmet.triggerExpansionOnTab": true

I don't know why this setting has to be enabled for it to work, but it works!

@shiraz @rickyalmeidadev

@rzhao271 rzhao271 added bug Issue identified by VS Code Team member as probable bug emmet Emmet related issues regression Something that used to work is now broken and removed info-needed Issue requires more information from poster labels Nov 15, 2021
@rzhao271 rzhao271 added this to the November 2021 milestone Nov 15, 2021
@rzhao271 rzhao271 added the confirmed Issue has been confirmed by VS Code Team member label Nov 15, 2021
@rzhao271
Copy link
Contributor

This regression is from the extension not activating in time for those file types. For example, if you manually expand an abbreviation with the command in the command palette, then the extension activates, and suggestions show up again.

@paragkatoch
Copy link

paragkatoch commented Nov 20, 2021

I am experiencing this issue after updating to version: 1.62.3
and I already have emmet.triggerExpansionOnTab in my setting.json file

@gjsjohnmurray
Copy link
Contributor

I am experiencing this issue after updating to version: 1.62.3

@preIdiot the fix by @rzhao271 is in 1.63, so either use Insiders or wait for the next release, due in early December.

@TarasIvaschuk
Copy link

I tried "emmet.triggerExpansionOnTab": true on Windows though it couldn't help me (

@TarasIvaschuk
Copy link

So figured out the workaround. I opened a *.html file found Emmet working there. After heading back to javascript files they got the Emmet abbreviations working. I do not know why but it helps

@paragkatoch
Copy link

I switched to v1.61, everything is working fine on that.

@rzhao271
Copy link
Contributor

Verification steps:

  1. Add the following setting
"emmet.includeLanguages": {
    "javascript": "javascriptreact"
}
  1. Open a folder or workspace
  2. Close all open editors and reload the window
  3. Create a JS file
  4. Do Steps 3 and 4 of Emmet does not work in js/jsx files for VS Code 1.62.2(Universal) #137012 (comment)

Expected: Emmet should activate more readily now, meaning that suggestions should show up during the last step.
Previous behaviour: Emmet wasn't activating when users opened a JS file, meaning suggestions would not show up.

@paragkatoch
Copy link

paragkatoch commented Nov 23, 2021

Not working @rzhao271

emmet.not.working.mp4

@gjsjohnmurray
Copy link
Contributor

@preIdiot your test seems to be done with Stable, so not 1.63 which is still Insiders.

@rzhao271
Copy link
Contributor

@preIdiot you have to use https://code.visualstudio.com/insiders/

@aeschli
Copy link
Contributor

aeschli commented Dec 2, 2021

Verified. You also need to make sure your file has set JavaScript React as language.

@aeschli aeschli added the verified Verification succeeded label Dec 2, 2021
@sahilsuman933
Copy link

I found a fix!

I could solve this by enabling emmet.triggerExpansionOnTab:

"emmet.triggerExpansionOnTab": true

I don't know why this setting has to be enabled for it to work, but it works!

@shiraz @rickyalmeidadev

It worked for me

@github-actions github-actions bot locked and limited conversation to collaborators Dec 30, 2021
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 confirmed Issue has been confirmed by VS Code Team member emmet Emmet related issues insiders-released Patch has been released in VS Code Insiders regression Something that used to work is now broken verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

10 participants