Skip to content
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

classRegex not working with Dart files in WebStorm #1081

Closed
moshe5745 opened this issue Nov 4, 2024 · 5 comments
Closed

classRegex not working with Dart files in WebStorm #1081

moshe5745 opened this issue Nov 4, 2024 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@moshe5745
Copy link

moshe5745 commented Nov 4, 2024

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?

@moshe5745 moshe5745 changed the title Intellisense not in html syntax Intellisense with regex not working Nov 5, 2024
@miniluz
Copy link

miniluz commented Nov 5, 2024

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)?(?:: .*)? \\=([^;]*);", "\\`([^\\`]*)\\`"]
  ]
}

@thecrypticace thecrypticace self-assigned this Nov 5, 2024
@thecrypticace thecrypticace changed the title Intellisense with regex not working classRegex not working with Dart files in WebStorm Nov 5, 2024
@thecrypticace
Copy link
Contributor

Hey I'm not seeing this here in the latest version of WebStorm:

Image

I did have to update the version of the language server it's using though. It's on an older version (I'm not sure if that's related to the already existing install of WebStorm I had though). I'm not too familiar with WebStorm so I wasn't sure if there was a way to get it to update from NPM in the UI.

@thecrypticace thecrypticace added the question Further information is requested label Feb 12, 2025
@thecrypticace
Copy link
Contributor

Ah wait this is about Dart files. please hold… 🤦‍♂

@thecrypticace
Copy link
Contributor

This seems to work if you pretend Dart files are JS in the Tailwind CSS settings:

Image

This might be good enough but we'd probably need to add explicit language support for dart if this causes problems. Mind giving this a test?

@moshe5745
Copy link
Author

Works fine. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants