tailwindlabs / tailwindcss-intellisense

Intelligent Tailwind CSS tooling for Visual Studio Code
2.86k stars 195 forks source link

classRegex not working with Dart files in WebStorm #1081

Open moshe5745 opened 3 days ago

moshe5745 commented 3 days ago

What version of VS Code are you using?

WebStorm 2024.2.4

What version of Tailwind CSS IntelliSense are you using?

v0.0.26

What version of Tailwind CSS are you using?

v3.4.14

What package manager are you using?

pub

What operating system are you using?

macOS

Tailwind config

/** @type {import('tailwindcss').Config} */
module.exports = {
    content: ['./{lib,web}/**/*.dart'],
    theme: {
        extend: {},
    },
    plugins: [
        require("daisyui")
    ],
}

tailwind-intellisense-settings

{
  "includeLanguages": {
    "ftl": "html",
    "jinja": "html",
    "jinja2": "html",
    "smarty": "html",
    "tmpl": "gohtml",
    "cshtml": "html",
    "vbhtml": "html",
    "razor": "html",
    "dart": "html"
  },
  "files": {
    "exclude": [
      "**/.git/**",
      "**/node_modules/**",
      "**/.hg/**",
      "**/.svn/**"
    ]
  },
  "emmetCompletions": false,
  "classAttributes": ["class", "className", "ngClass", "classes"],
  "colorDecorators": false,
  "showPixelEquivalents": true,
  "rootFontSize": 16,
  "hovers": true,
  "suggestions": true,
  "codeActions": true,
  "validate": true,
  "lint": {
    "invalidScreen": "error",
    "invalidVariant": "error",
    "invalidTailwindDirective": "error",
    "invalidApply": "error",
    "invalidConfigPath": "error",
    "cssConflict": "warning",
    "recommendedVariantOrder": "warning"
  },
  "experimental": {
    "configFile": "tailwind.config.js",
    "classRegex": ["\\W\\s*classes:\\s*'(.*)'"]
  }
}

Describe your issue

I have a dart web project(using jaspr framework). When I used dart_frog everything worked fine because I served regular HTML with class attribute. But jaspr using classes for representing the UI and then renders it to the client. So basically it looks like this inside my dart files.

svg(classes: 'size-6')

So I use regex but its not working. I know other people using exactly the same configs in VSCode and its working.

Any help?

miniluz commented 1 day ago

Not working for me either sadly. I'm using workspace settings, if that matters.

I'm using:

{
  "tailwindCSS.experimental.classRegex": [
    ["[cC]lass(?:es)?(?:: .*)? \\=([^;]*);", "'([^']*)'"],
    ["[cC]lass(?:es)?(?:: .*)? \\=([^;]*);", "\"([^\"]*)\""],
    ["[cC]lass(?:es)?(?:: .*)? \\=([^;]*);", "\\`([^\\`]*)\\`"]
  ]
}