Skip to content

Emmet tweaks: simplify set/reset Emmet preferences and syntax profiles - #11003

Merged
Erich Gamma (egamma) merged 1 commit into
microsoft:masterfrom
mrmlnc:fix-emmet-preferences-reset
Aug 28, 2016
Merged

Erich Gamma (egamma) merged 1 commit into
microsoft:masterfrom
mrmlnc:fix-emmet-preferences-reset

Conversation

@mrmlnc

Copy link
Copy Markdown
Contributor

Source: #9500 and #9002

The process of set/reset preferences and syntax profiles for Emmet has been simplify. We don’t have to support undocumented features of Emmet, which don’t have any sense for the end user.

Just use Emmet API.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 60.967% when pulling f6677f1 on mrmlnc:fix-emmet-preferences-reset into 6ae0573 on Microsoft:master.

@egamma

Copy link
Copy Markdown
Member

LGTM to thanks 🌹

@egamma

Copy link
Copy Markdown
Member

Denis Malinochkin (@mrmlnc) since this change this preference setting results in an error:

{
    "emmet.preferences": {
         "less.propertyEnd": "END"
     }
}

image

Therefore my question is less.propertyEnd a supported setting?
The implementation before this PR made sure that this property is defined in the case emmet complains:

        for (let key in preferences) {
            try {
                _emmet.preferences.set(key, preferences[key]);
            } catch (err) {
                _emmet.preferences.define(key, preferences[key]);
            }
        }

@mrmlnc

Denis Malinochkin (mrmlnc) commented Sep 1, 2016 •

Copy link
Copy Markdown
Contributor Author

Erich Gamma (@egamma), unfortunately, it's my mistake. I forgot about it. 😞

This PR, as specified in the description to it, removes support for undocumented features of Emmet, which don’t have any sense for the end user.

Correct code:

try {
  _emmet.loadPreferences(emmetPreferences.preferences);
  _emmet.loadProfiles(emmetPreferences.syntaxProfiles);
} catch(err) {
  // silence
}

Available settings: http://docs.emmet.io/customization/preferences/

Erich Gamma (egamma) added a commit that referenced this pull request Sep 1, 2016
@egamma

Copy link
Copy Markdown
Member

Denis Malinochkin (@mrmlnc) no problem, pushed the fix, thanks.

@egamma Erich Gamma (egamma) added this to the August 2016 milestone Sep 5, 2016
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants