windicss / windicss-intellisense

Intelligent WindiCSS tooling for VS Code
https://marketplace.visualstudio.com/items?itemName=voorjaar.windicss-intellisense
MIT License
194 stars 16 forks source link

Intellisense support for ERB files? #223

Closed angelocordon closed 3 years ago

angelocordon commented 3 years ago

Hi all,

I've noticed that my intellisense works for my TSX files but can't seem to make it work for my ERB files. I've tried including this in my user settings:

"windicss.includedLanguages": {
  "erb": "html" // I've also tried using "*.html.erb" and "html.erb"
}

Am I using this configuration incorrectly? Thanks in advance!

alexanderniebuhr commented 3 years ago

@angelocordon erb are ruby files? Then I think you should use the language identifier ruby.

"windicss.includedLanguages": {
  "ruby": "html"
}

If you need custom pattern, you can also use more advanced configuration, described in the readme. https://github.com/windicss/windicss-intellisense/blob/c0e057e4ac21b4f71cd0f7c7be006d6492cca5ea/README.md#L103-L112

angelocordon commented 3 years ago

Thanks for the input here @alexanderniebuhr - sorry for the delayed reply. I'm not sure how this works all of the sudden, but somehow it started working today. I'm not positive what happened in between, but upon some short investigation I've found this setting works but not the windicss.includeLanguages key:

{
   "file.associations": {
        ".html.erb": "html"
    }
}

☝🏽 This was taken from the Tailwind Intellisense config and I made sure that I do not have that extension installed.

In any case, feel free to close this issue? I'd be curious to try to deeper understand how this setting works, and if there's some directions you'd like me to explore, I'd be happy to. Thanks so much!

alexanderniebuhr commented 3 years ago

use latest release v0.21.3 and the following config and it should allow autocompletion. You should not need the file.associations setting

"windicss.includeLanguages": {
    "ruby": {
        "type":"html",
        "patterns": [
            "(\\s*class\\s*=\\>\\s*{?\\s*[\"'`])[^\"'`]*$"
        ]
    }
}