zignd / HTML-CSS-Class-Completion

:chocolate_bar: Visual Studio Code extension that provides CSS class name completion for the HTML class attribute based on the CSS files in your workspace
https://marketplace.visualstudio.com/items?itemName=Zignd.html-css-class-completion
MIT License
253 stars 83 forks source link

User defined languages #277

Closed natecorkish closed 3 years ago

natecorkish commented 3 years ago

This pull request gives the end user the choice to choose their own languages to show css completions. For example, say someone wants to add autocompletions to a file called .johndoe they can add it to their settings like so:

    "html-css-class-completion.enabledHTMLLanguages": [
        "html",
        "django-html",
        "razor",
        "php",
        "blade",
        "vue",
        "twig",
        "markdown",
        "erb",
        "handlebars",
        "ejs",
        "svelte",
       "johndoe"
    ],

This will save time for all the individual edge cases we have with people wanting support for different file types.

vikbert commented 3 years ago

nice feature. it will be nice to get this PR merged as soon as possible. thx.

v-erse commented 3 years ago

@zignd bump. This would be nice to have, love this extension but I can't use it with svelte!

zignd commented 3 years ago

That's an amazing contribution @natecorkish! I'll test it and release it as soon as I can!

By the way, thanks for the mention @a6h-s, I totally missed the initial notification for this PR.

zignd commented 3 years ago

@natecorkish I was trying it out locally and it's working perfectly, but I did notice that when the user updates the configurations, the changes are not taking place. I believe it's likely because it's necessary to listen to those changes here in the code and then properly update the context.subscriptions.

Do you think you could add this detail as well? Otherwise I can still do it on my side once I merge it, no problem at all. Also, thanks for taking your time to implement it :)

zignd commented 3 years ago

Merged to master manually https://github.com/zignd/HTML-CSS-Class-Completion/commit/524b4f02d8ccd7fad48c2f7bafe9fc38db451c80. I'm still going to write some documentation tomorrow to explain this feature before the release and I'm also considering writing some tests as well.

vikbert commented 3 years ago

nice work. keep going. thx