Repository navigation
xhtml is a profile not syntax in emmet - #18625
Conversation
bd066e4 to
93437ef
Compare
There was a problem hiding this comment.
Removing xhtml from the list of emmetSupportedModes makes sense. Since in VS Code we have no language mode for xhtml but only html.
I'm now confused by this code that uses a profile to override the editors syntax. It was introduced as a partial fix for #9500 67bbb46.
// user can overwrite the syntax using the emmet syntaxProfiles setting
let profile = this.getSyntaxProfile(syntax);
if (profile) {
return profile;
}We are configuring emmet with the user defined profiles and preferences here. Therefore we should let emmet handle the profiles. I'm therefore thinking we should remove the above code alltogether. It causes the issue in #18434 and this PR works around this code for xhtml.
Denis Malinochkin (@mrmlnc) what am I missing 😄
|
Erich Gamma (@egamma) That is the part that enables emmet support for languages other than the "known" modes. What you linked loads profiles, yes, but here profile means the way html is output (like self closing tags, single quote for attributes etc.). |
416bdf7 to
647f002
Compare
|
Sorry, i'll see all issues with Denis Malinochkin (@mrmlnc) tomorrow 👍 (now I have a lot of work on a new place of work 🔮) |
Then isn't the root cause of the issue that we overload the setting Isn't a better fix is to eliminate this overloading and introduce a separate setting, e.g., "emmet.mapLanguage": {
"java": "html"
}Denis Malinochkin (@mrmlnc) what do you think? |
That was my first thought as well. But, that would break the experience for people who have already started using |
|
Hm, i don't fully understand your thoughts.
Works for me inside I'll look at this task in more detail soon. |
|
Denis Malinochkin (@mrmlnc) Now, when we set |
647f002 to
617b667
Compare
|
Erich Gamma (@egamma) I have updated the PR with a slightly better fix.
// user can overwrite the syntax using the emmet syntaxProfiles setting
let profile = this.getSyntaxProfile(syntax);
if (profile && this.emmetSupportedModes.indexOf(profile) !== -1) {
return profile;
}I believe this is a good solution for the current iteration. But looking at the big picture, we should ideally have a separate setting for mapping languages to known syntax. |
|
Ramya Rao (@ramya-rao-a) 👍 This is a good fix and we can still look into adding a separate setting. |
|
Thanks Erich Gamma (@egamma) PR is merged. |
#18434 (comment)
cc: Denis Malinochkin (@mrmlnc) Erich Gamma (@egamma)