Skip to content

Not working in VS code #277

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

Closed
HartS opened this issue Mar 17, 2021 · 1 comment
Closed

Not working in VS code #277

HartS opened this issue Mar 17, 2021 · 1 comment

Comments

@HartS
Copy link

HartS commented Mar 17, 2021

In VS code, I'm not able to get intellisense working in a Typescript+react project (component files are using the extension .tsx)

In my .vscode/settings.json file:

  "tailwindCSS.includeLanguages": {
    "typescript": "javascript",
    "typescriptReact": "javascript",
    "plaintext": "javascript",
  },
  "css.validate": false,
  "tailwindCSS.validate": true,
  "files.exclude": {
    "node_modules": true,
    "dist": true,
    "**/*.js": true,
    "**/*.jsx": true
  }

The text for this section is unhighlighted, and hovering tells me This setting cannot be applied in this workspace. It will be applied when you open the containing workspace folder directly.

My code-workspace file:

{
  "folders": [
    {
      "path": "."
    }
  ],
}

And in my user settings:

    "[typescript]": {
        "tailwindCSS.validate": true,
        "tailwindCSS.experimental.classRegex": ["className"],
        "editor.defaultFormatter": "vscode.typescript-language-features"
    },

I've tried multiple combinations of the tailwind settings; still, no luck. Anything else I can/should try?

@HartS
Copy link
Author

HartS commented Mar 17, 2021

Much gratitude to @bradlc for helping me resolve this in the tailwind discord 👏

The issue was that I had excluded all JS files in my vs code settings, as this prevents vs code from reading the tailwindconfig.js file. The resolution was to change that exclude to match src/**/*.js instead of **/*.js . After restarting vs code I now have intellisense whenever I edit a className!

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

No branches or pull requests

1 participant