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

Make emmet.syntaxProfiles configuration item to support custom language Id #95

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Tenormis
Copy link

@Tenormis Tenormis commented Sep 5, 2024

Make emmet.syntaxProfiles configuration item to support custom language Id. For example:

Previously, if you wanted to modify the final output of Markdown Emmet, you had to configure it like this:

  "emmet.includeLanguages": { "markdown": "html" },
  "emmet.syntaxProfiles": {
    "html": { // modified the html configuration
      "tag_nl": false,
      "tag_nl_leaf": false
    }
  },

Since it modifies the html configuration, the output for the HTML language will also be affected. With this commit, it is now supported:

  "emmet.includeLanguages": { "markdown": "html" },
  "emmet.syntaxProfiles": {
    "markdown": { // only modified the markdown configuration
      "tag_nl": false,
      "tag_nl_leaf": false
    }
  },

This way, only the markdown configuration is modified, and the HTML language configuration will not be affected.

@Tenormis
Copy link
Author

Tenormis commented Sep 5, 2024

@rzhao271 Looking forward to your approval 😀

@Tenormis
Copy link
Author

Can anyone help approve it 😭

@rzhao271
Copy link
Contributor

Hi, thanks for the bump!

l10n = require('vscode').l10n;
var vscode = require('vscode');
l10n = vscode.l10n;
getProfileOfCurrentLanguageId = (profilesConfig: any) => profilesConfig[vscode.window.activeTextEditor.document.languageId];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this section only run right when the package is loaded?
To override the use of profilesConfig[syntax], you might have to change the getProfile API or provide a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants