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

Purpose of emmet.syntaxProfiles is unclear #29678

Closed
Tyriar opened this issue Jun 27, 2017 · 19 comments
Closed

Purpose of emmet.syntaxProfiles is unclear #29678

Tyriar opened this issue Jun 27, 2017 · 19 comments
Assignees
Labels
emmet Emmet related issues verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Jun 27, 2017

  • VSCode Version: Code - Insiders 1.14.0-insider (15b579d, 2017-06-27T05:11:33.154Z)
  • OS Version: Linux x64 4.10.0-24-generic
  • Extensions:
Extension Author (truncated) Version
EditorConfig Edi 0.9.3
lorem-ipsum Tyr 1.0.0
sort-lines Tyr 1.3.0
vscode-svgviewer css 1.4.2
tslint eg2 0.15.0
git-project-manager fel 1.3.2
md-navigate jri 0.0.1
vscode-scss mrm 0.6.2
seti-icons qin 0.1.3
vim vsc 0.9.0

(1 theme extensions excluded)


#29500

I set this but it didn't allow me to expand within a .ts file.

"emmet.syntaxProfiles": {
  "typescript": "html"
},
@Tyriar Tyriar added the emmet Emmet related issues label Jun 27, 2017
@vscodebot vscodebot bot added the insiders label Jun 27, 2017
@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Jun 27, 2017

Did you try the Emmet: Expand Abbreviation command or you are expecting the auto completion?

The former should work. The latter I disabled as it becomes too noisy when emmet suggestions pop up every where in the while instead of just the html/css parts of the file.

@Tyriar
Copy link
Member Author

Tyriar commented Jun 27, 2017

@ramya-rao-a I tried auto completion, if that's not supported maybe there should be a note in the setting description?

@Tyriar
Copy link
Member Author

Tyriar commented Jun 27, 2017

@ramya-rao-a it worked via command.

@ramya-rao-a ramya-rao-a added this to the June 2017 milestone Jun 27, 2017
@ramya-rao-a ramya-rao-a added the under-discussion Issue is under discussion for relevance, priority, approach label Jun 27, 2017
@Tyriar
Copy link
Member Author

Tyriar commented Jun 27, 2017

@ramya-rao-a I can't imagine actually doing this and finding it useful. There should be a note in the description though to make it clear how to use it for people like me who don't really use the command.

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Jun 27, 2017

Using syntaxProfiles for mapping a language to one of the emmet supported ones was introduced back in September. See https://code.visualstudio.com/updates/v1_5#_settings-to-enabledisable-emmet-for-languages

syntaxProfiles was already being used for a whole different purpose. Which was to define the output profile as defnied here: https://docs.emmet.io/customization/syntax-profiles/

This was re-used in September to be used for enabling emmet in other languages.

Back in February, I fixed a few issues around this. But the real fix is to separate the output profile settings from the language mapping settings which I have been wanting to do for a while.

@ramya-rao-a
Copy link
Contributor

Here is my proposal:

In the new emmet model, we will use a new setting emmet.includeLanguages to enable emmet abbreviations in languages that are not supported by default.
emmet.syntaxProfiles will be used only for setting the output profile as defined https://docs.emmet.io/customization/syntax-profiles/ and not to map languages to emmet supported modes

Pros:

  • Intuitive to new users
  • No confusion to emmet users coming from other editors as syntaxProfiles means exactly what was documented in the emmet website https://docs.emmet.io/customization/syntax-profiles/
  • Naming is self-explanatory and is a good opposite to emmet.excludeLanguages
  • This will only come into affect when emmet.useNewEmmet is true

Cons

  • Existing VS Code emmet users who have been using emmet.syntaxProfiles to map languages will have to make a change.
  • There are a few docs and tweets out there that we need to update

cc @egamma @mrmlnc

@ifzm
Copy link

ifzm commented Jun 28, 2017

I found it now emmet.syntaxProfiles & emmet.useNewEmmet: true can not coexist (
For example: I set vue to syntaxProfiles, and then set useNewEmmet: true, in the vue file emmet can not be used.

@ramya-rao-a
Copy link
Contributor

@ifzm Are you referring to the Emmet: Expand Abbreviation command or the emmet abbreviations showing up in the suggestion list? The former should work as long as you have the mapping "vue-html": "html". The suggestions will work once they are implemented by language specific extensions. You can follow #29114

@ifzm
Copy link

ifzm commented Jun 28, 2017

Thanks for your answer ).
Yes,i think I may not be clear, the actual problem is this "emmet.syntaxProfiles" not working with "emmet.useNewEmmet" (emmet 2.0)

@jens1o
Copy link
Contributor

jens1o commented Jun 28, 2017

I like your proposal!

@TRex247
Copy link

TRex247 commented Jun 28, 2017

The new settings emmet.includeLanguages is a nice problem.

@TRex247
Copy link

TRex247 commented Jun 28, 2017

The new setting emmet.includeLanguages is a nice proposal.

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Jun 28, 2017

I had a day to think about this and am going ahead with it.
The pros in #29678 (comment) outweigh the cons

emmet.includeLanguages will be used in the new emmet model to map languages unsupported by emmet to one of the languages that is supported by emmet.

emmet.sytnaxProfiles will continued to be used for the same purpose, but only in the old emmet model

yay!

The change will be available in the next Insiders (29th June, 2017)

@ramya-rao-a ramya-rao-a added verification-needed Verification of issue is requested and removed insiders under-discussion Issue is under discussion for relevance, priority, approach labels Jun 28, 2017
@ifzm
Copy link

ifzm commented Jun 29, 2017

nice 👍

@chrmarti chrmarti added the verified Verification succeeded label Jun 30, 2017
@yordis
Copy link

yordis commented Jul 5, 2017

@ramya-rao-a is this deployed yet?

@ramya-rao-a
Copy link
Contributor

In the Insiders, yes.
For the stable build, wait for the release of VS Code 1.14
In both cases ensure "emmet.useNewEmmet" is ser to true

@Elyx0
Copy link

Elyx0 commented Jul 17, 2017

VERSION: 1.14

My user settings contained the following:

    "emmet.useNewEmmet": true,
    "emmet.syntaxProfiles": {"handlebars": "html"},
    "emmet.includeLanguages": {"handlebars": "html"},

Emmet wasn't available in my handlebars files :(

Only fix was "emmet.showExpandedAbbreviation": "always"

@ramya-rao-a
Copy link
Contributor

@Elyx0 That is covered in #28545 Please follow that issue

@kopickik
Copy link

If anyone else wound up here trying to get html snippets to work in *.blade.php files, the fix is to add them to blade.json instead of html.json from the User Snippets menu.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
emmet Emmet related issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

9 participants