windicss-intellisense icon indicating copy to clipboard operation
windicss-intellisense copied to clipboard

intellisense in template strings

Open woldtwerk opened this issue 3 years ago • 5 comments

Hi, I want to use windi with lit. I can't get the intellisense working in the template strings. e.g.:

html`<div> class='w-20'></div>`

I tried multiple different pattern in my settings, but I can't get it to work.

"typescript": {
      "type": "js",
      "patterns": [
        "(\\s+class\\s*=\\s*{?\\s*[\"'\\`])[^\"'\\`]*$"
      ] 
    },

I would greatly appreciate a tip.

woldtwerk avatar Aug 22 '21 15:08 woldtwerk

@woldtwerk that works in js and ts files. If the pattern does not work for you, I think the VS Code identifier for lit the key where you have typescript, might be different

"windicss.includedLanguages": {
   "javascript": {
     "type": "js",
     "patterns": ["\\s+class\\s*=\\s*{?\\s*[\"'`][^\"'`]*$"]
   }
 }

alexanderniebuhr avatar Aug 22 '21 16:08 alexanderniebuhr

@alexanderniebuhr Oddly enough it works correctly in plain js files. Shouldn't it work out of the box in ts files if it works in js?

woldtwerk avatar Aug 22 '21 16:08 woldtwerk

yeah it should work exactly the same. Just tested it with ts file.. getting same issue. Not sure what is happening here. Might interfere with some other completions of language server or so. :(

alexanderniebuhr avatar Aug 22 '21 17:08 alexanderniebuhr

If I do it like this it works:

"windicss.includedLanguages": {
"typescript": "javascript",
}

gonna try adding a pattern so it works for classmap aswell.

woldtwerk avatar Aug 22 '21 17:08 woldtwerk

Just had the same issue on a tsx file.

SimHoZebs avatar Nov 29 '21 12:11 SimHoZebs