Skip to content

Emmet too active in files such as JSX, TSX, and PHP  #51537

Open

Description

@garyking
  • VSCode Version: Version 1.24.0 (1.24.0)
  • OS Version: macOS 10.13.4 (17E199)

Steps to Reproduce:

  1. Open a new file, set language to javascriptreact.
  2. Add the following code:
const arr = [1, 2, 3]
const i = 0

arr[i|]
  1. The location where the pipe is, after typing the i, the suggestions will appear, and the top suggestion is Emmet.

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

Activity

  1. added
    bug
    emmet
    on Sep 12, 2018
  2. ramya-rao-a commented on Nov 19, 2018

    @ramya-rao-a
    Contributor

    Fixing this would require us to parse the file and figure out if the current position is js or html which we cannot do at the moment. Keeping this issue open to track all further issues around emmet and js.

    Until then, I would suggest to set emmet.showExpandedAbbreviation to inMarkupAndStylesheetFilesOnly when you are doing purely js work. This will disable emmet completions in jsx files while still retaining it for html and css files. When you want to use emmet in jsx file, change the same setting back to always

  3. changed the title [-]Emmet is the top suggestion when typing a variable inside brackets in JS[/-] [+]Emmet is the top suggestion when typing javascript code[/+] on Nov 19, 2018
  4. changed the title [-]Emmet is the top suggestion when typing javascript code[/-] [+]Emmet too active in javascriptreact files[/+] on Nov 10, 2020
  5. joaomoreno commented on Nov 25, 2020

    @joaomoreno
    Contributor

    Raymond Zhao (@rzhao271) I don't mind that Emmet suggests. It's just that it's always above the TypeScript suggestions, and I often pick it on Enter. Can we do something about that?

  6. Fosol commented on Dec 27, 2021

    @Fosol

    I can't get my styled components to work because of this bug. But the workaround doesn't work either.

  7. 1 remaining item

  8. didii commented on Mar 4, 2022

    @didii

    Until then, I would suggest to set emmet.showExpandedAbbreviation to inMarkupAndStylesheetFilesOnly when you are doing purely js work.

    Pair that setting together with emmet.triggerExpansionOnTab to true and you can tab once to complete whatever autocomplete is suggesting, and tab again to expand the emmet abbreviation for jsx files. This is the behavior I personally was looking for.

  9. rzhao271 commented on Apr 4, 2022

    @rzhao271
    Collaborator

    I'm merging the original issue with #138461.
    For the styled-components issue, I'll track it in #142302.

  10. removed this from the Backlog milestone on Apr 4, 2022
  11. locked and limited conversation to collaborators on May 19, 2022
  12. rzhao271 commented on Jul 27, 2022

    @rzhao271
    Collaborator

    Reopening this issue as a catch-all.

  13. unlocked this conversation on Mar 6, 2024
  14. changed the title [-]Emmet too active in javascriptreact files[/-] [+]Emmet too active in files such as JSX, TSX, and PHP [/+] on Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugemmetemmet-parse

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions