Skip to content

Added support for emmet snippets #86

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

Closed
wants to merge 3 commits into from
Closed

Added support for emmet snippets #86

wants to merge 3 commits into from

Conversation

WaqasIbrahim
Copy link
Contributor

I have added support for emmet snippets for html, php and handlebars. Adding more languages to the list is pretty easy. @zignd Can you please review this?

You will need to change "html-css-class-completion.enabledForEmmet": false to true to trigger auto-completion for emmet snippets.

src/extension.ts Outdated
@@ -12,6 +12,10 @@ let uniqueDefinitions: CssClassDefinition[];

const completionTriggerChars = ['"', '\'', ' '];

const config = vscode.workspace.getConfiguration('html-css-class-completion');
const enabledForEmmet = config.get('enabledForEmmet');
if(enabledForEmmet) completionTriggerChars.push('.');
Copy link
Owner

@zignd zignd Sep 12, 2017

Choose a reason for hiding this comment

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

It would be nice to the user experience ✨ if once a change is made to the configuration it took effect without the need to restart the editor. Do you think you can modify this section to make use of the vscode.workspace.onDidChangeConfiguration event?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, I tried using this event but there is a problem. If let's say we switch from "html-css-class-completion.enabledForEmmet": false to true. That works because we simply register new completion providers. But if we switch back to false, we need to remove those providers. I can't seem to find any solution for this in documentation.

Copy link
Owner

Choose a reason for hiding this comment

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

I'll try to look for a solution regarding the removal of a registered content provider, but maybe we should simply remove the parameter and leave this feature enabled by default.

Copy link
Contributor Author

@WaqasIbrahim WaqasIbrahim Sep 13, 2017

Choose a reason for hiding this comment

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

Not everyone uses emmet snippets. Actually most people don't use emmet and as it triggers on a ., leaving it enabled by default will be intrusive and costly in performance.

How about we show a message to users to restart the editor if the configuration for the extension is changed? Least we can do is provide feedback.

@zignd
Copy link
Owner

zignd commented Sep 12, 2017

By the way, sorry for taking this long to reply.

@stefanomonteiro
Copy link

Is it working already?

@zignd
Copy link
Owner

zignd commented Feb 14, 2018

Not yet, there's a small thing we have to fix, so that when you change the configuration the extension recognizes it and perform a re-cache automatically. I'll work on it until this Saturday, so you can use it then, or maybe by tomorrow depending on how much free time I end up having.

@zignd
Copy link
Owner

zignd commented Feb 18, 2018

@stefanomonteiro it is now available in the latest version.

@zignd zignd closed this Feb 18, 2018
@stefanomonteiro
Copy link

stefanomonteiro commented Feb 19, 2018

@zignd Great Job!!!! Thank you!!!

cvharris pushed a commit to cvharris/HTML-CSS-Class-Completion that referenced this pull request Jun 25, 2018
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.

3 participants