RubyMine (IntelliJ) Tailwindcss plugin with Rails
I'm finally working on adding Tailwind to my projects (a bit behind the curve, I know). I am working on a Rails 8 application created from scratch with the --css=tailwind flag – I have tailwind imported in app/assets/tailwind/application.css (the Rails default). My project *does not* have a package.json (I am using importmap) and the tailwind preprocessing is handled by foreman through the standard Rails bin/dev script.
In RubyMine, I have the Tailwind plugin activated, Node is installed on the system, the language server is installed (and selected in plugin settings) and the plugin configuration has been updated to support Slim for this project, with the “slim”: “slim” language deceleration and the “emmetCompletions” option turned on.
Despite all these configurations seeming correct, I am not seeing any Tailwind completion suggestions in Slim templates, nor in a scratch HTML file. My best guess is that the plugin is looking for an import and not seeing the one in the assets directory since that is processed by foreman/rails rather than directly imported. If this is the cause, how can I force the plugin to run on all slim/html/erb files, and if not, what should I check to determine the actual cause?
请先登录再写评论。
Update to this after more exploration:
In my application's css file, where Tailwind is explicitly imported, I do see Tailwind classes suggested (with the “C” icon indicating that they are suggested based on names seen elsewhere in the project), but despite the configuration for the plugin containing `.slim` and `.erb` files, by templates still do not get class names suggested, likely as the plugin doesn't realize that Tailwind is imported here. I want to force the plugin to always run for this project anytime I'm in an HTML, ERB, or slim file.
The
tailwindcss-railsgem uses standalone tailwind executable https://tailwindcss.com/blog/standalone-cli; but the tailwind language server requires thetailwindcsspackage +Node.js. That's why no completion is provided. Please subscribe to https://youtrack.jetbrains.com/issue/WEB-55647/Support-Tailwind-css-autocompletion-using-standalone-tailwind-CLI to get notified on any progress with it.The Tailwind plugin expects a direct import, but you're using importmap, so it's not detecting Tailwind. Try configuring the plugin to recognize importmap or adjust its settings to work with Rails and Slim files. You might need to point it to the correct directories or use a different setup for compatibility.