-
Notifications
You must be signed in to change notification settings - Fork 85
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
Conversation
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('.'); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
By the way, sorry for taking this long to reply. |
Is it working already? |
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. |
@stefanomonteiro it is now available in the latest version. |
@zignd Great Job!!!! Thank you!!! |
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
totrue
to trigger auto-completion for emmet snippets.