Skip to content

Option to show emmet suggestions in languages that are not pure mark up or stylesheet like #29532

Closed

Description

  • VSCode Version: Code - Insiders 1.14.0-insider (15b579d, 2017-06-27T05:16:51.982Z)
  • OS Version: Windows_NT ia32 10.0.10586
  • Extensions: All disabled

Steps to Reproduce:

  1. Create a new file with the following content:
import React from "react";

class MyComponent extends React.Component {
  
  render() {
   return div
  }
}

export default MyComponent;
  1. Set language mode of the file to javascriptreact.
  2. Place cursor after the div and trigger suggestion list.

Expected: The suggestion list contains the "expand emmet abbreviation" for the div tag.
Actual: The suggestion list contains no emmet entry at all.

Activity

  1. added
    emmet
    on Jun 27, 2017
  2. geirsagberg commented on Jun 27, 2017

    @geirsagberg
    Contributor

    Also affects .tsx / Typescript React.

  3. ramya-rao-a commented on Jun 27, 2017

    @ramya-rao-a
    Contributor

    We decided to disable the emmet abbreviations in the suggestion list in languages that are not pure mark up or stylesheet like. The reason was that there was no easy way for the emmet extension to understand the underlying language and identify the areas of the code where it should suggest emmet.

    For example, in case of javascriptreact/typescriptreact, the emmet suggestions would show up no matter where (js vs html) you were typing. This got very noisy because in a jsx file you are most of the time writing js.

    The solution we are aiming for is this:

    So, now this issue becomes an extension candidate.

    Note that the command Emmet: Expand Abbreviation and Emmet: Wrap with Abbreviation will continue to work in jsx/tsx files. Bind a keyboard shortcut for Emmet: Expand Abbreviation (other than tab) and you will be able to expand emmet abbreviations anywhere in jsx file

  4. added
    *extension-candidate
    feature-request
    and removed on Jun 27, 2017
  5. changed the title [-]emmet expansion not working in jsx files (javascriptreact)[/-] [+]emmet expansion suggestions should show up in jsx files (javascriptreact)[/+] on Jun 27, 2017
  6. tklepzig commented on Jun 27, 2017

    @tklepzig
    Author

    Ok, I understand your point. Is there maybe a chance to add an entry in the settings to change this, so to enable the emmet abbreviations in certain languages?

  7. ramya-rao-a commented on Jun 27, 2017

    @ramya-rao-a
    Contributor

    Thomas Klepzig (@tklepzig) If there would be such a setting, are you saying you wouldnt mind the emmet suggestions showing up when you are writing javascript code in javascriptreact file?

  8. geirsagberg commented on Jun 27, 2017

    @geirsagberg
    Contributor

    Can't speak for Thomas Klepzig (@tklepzig), but I would certainly love the choice to press Tab to expand an Emmet snippet. That is more important than showing the suggestions, for me.

  9. tklepzig commented on Jun 27, 2017

    @tklepzig
    Author

    Yeah, I wouldn't mind if the emmet suggestions would show up in the whole jsx file.

  10. ramya-rao-a commented on Jun 27, 2017

    @ramya-rao-a
    Contributor

    Geir Sagberg (@geirsagberg) We are definitely moving away from binding Tab to Emmet. See https://code.visualstudio.com/updates/v1_13#_emmet-abbreviation-expansion-in-suggestion-list for more on this.

    You can still bind any other keyboard shortcut to Emmet: Expand Abbreviation command to get emmet expansions anywhere in the jsx file

    Thomas Klepzig (@tklepzig) I'll keep that in mind and look into options

  11. 21 remaining items

  12. ramya-rao-a commented on Jun 29, 2017

    @ramya-rao-a
    Contributor

    Thomas Klepzig (@tklepzig) I agree, but can't come up with a nice name for that. Trust me I have tried 😭 If you have any ideas, am open to suggestions.

    Jens Hausdorf (@jens1o) #27784 is about expansion not working at all when there is a grouping followed by multiplication. What Nana Asumadu (@nanaasumadu) is saying is that the suggestions stop showing when you hit *.
    That is related to #29758

    Nana Asumadu (@nanaasumadu) Until #29758 is completely fixed, as a work around you can still press Ctrl+Space and manually trigger the suggestion

  13. ramya-rao-a commented on Jun 29, 2017

    @ramya-rao-a
    Contributor

    Thanks for testing everyone!

  14. tklepzig commented on Jun 29, 2017

    @tklepzig
    Author

    Ramya Rao (@ramya-rao-a) Hm, what do think about something like defaultAndIncludedLanguages (could be improved, only an idea ;) ) and add javascriptreact and typescriptreact as default to includeLanguages?

  15. ramya-rao-a commented on Jun 29, 2017

    @ramya-rao-a
    Contributor

    Adding add javascriptreact and typescriptreact as default to includeLanguages doesn't make sense

    includeLanguages is to map a non supported language to a supported language

    like javascript: javascriptreact

  16. tklepzig commented on Jun 29, 2017

    @tklepzig
    Author

    Yeah, you are right, I forgot that it's a map, not just a list.
    So maybe just leave it to the user? In the way, that defaultAndIncludedLanguages doesn't add anything unless includeLanguages is modified (including javascriptreact and typescriptreact)?

  17. ramya-rao-a commented on Jun 29, 2017

    @ramya-rao-a
    Contributor

    I didnt want to include any references to the "includeLanguages" setting. Not many people would be aware of what that means.

    One option I was toying around was "never", "always" and "inHtmlAndCssOnly"

  18. tklepzig commented on Jun 30, 2017

    @tklepzig
    Author

    Ok, I see your point.
    Yeah, that sounds good, so all "combined" languages are excluded. Definitely a better name then the current one.

  19. ramya-rao-a commented on Jun 30, 2017

    @ramya-rao-a
    Contributor

    ya but the problem is languages like jade, haml, xml also should be included

    so more like "never", "always" and "inMarkupAndCssOnly"?

  20. tklepzig commented on Jun 30, 2017

    @tklepzig
    Author

    Yep, "Markup" sounds good. Should be clear enough which languages are included.

  21. ramya-rao-a commented on Jun 30, 2017

    @ramya-rao-a
    Contributor

    Done.

    See 158270d

  22. tklepzig commented on Jun 30, 2017

    @tklepzig
    Author

    Thx :)

  23. locked and limited conversation to collaborators on Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

emmetfeature-requestverification-neededverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions