sublimelsp / LSP-tailwindcss

Tailwind css support for Sublime's LSP plugin
MIT License
54 stars 5 forks source link

Configure this plugin for .html files using Jinja syntax? #47

Closed stfnx closed 1 year ago

stfnx commented 1 year ago

Hello, I have the following configuration and am wondering if it is possible to configure this plugin to work with my environment:

I've set tailwindCSS.experimental.configFile to tailwind/config.js, as described here. But since this settings wasn't included in the plugin's default settings, I'm not sure if this will work. When I open my Tailwind config I can see that LSP-tailwindcss is running at least...

When I now edit a .html file using the Jinja syntax, I can't see that LSP-tailwindcss is running. And I won't get completions for Tailwind class names.

I assume that I have to configure this with tailwindCSS.includeLanguages and selector plugin settings, but I heve no idea, what exactly to do.

Would be super cool if someone could get me starting on this one! Appreciate that Tailwind IntelliSense is available for Sublime!

rchl commented 1 year ago

You could try overriding selector (https://github.com/sublimelsp/LSP-tailwindcss/blob/master/LSP-tailwindcss.sublime-settings#L29) to include text.jinja.

stfnx commented 1 year ago

Thanks for the hint. Now LSP-tailwindcss is running when opening the files, but completions don't work.

rchl commented 1 year ago

I won't have time to dig deeper today but you could try using the default location for the tailwind configuration file as I'm not sure if we support that setting from tailwind server (it might be that we are outdated or that it's only supported by VSCode extension).

stfnx commented 1 year ago

I duplicated my tailwind config to the project's root directory and changed the paths inside it accordingly. No change, sadly.

rchl commented 1 year ago

On top of all above could also try setting:

    "settings": {
        "tailwindCSS.includeLanguages": {
            "jinja": "html"
        }
    }

but that's, again, untested.

stfnx commented 1 year ago

Still no completions showing up.

predragnikolic commented 1 year ago

Steps to enable in Jinja files:



![image](https://user-images.githubusercontent.com/22029477/198125393-5ebe8e0b-1d74-476e-b165-a379f6539397.png)
predragnikolic commented 1 year ago

@stfnx the fix is merged in LSP-tailwindcss and LSP. Just give PackageControl 1 to 3h to pick up the new LSP 4070-1.20.0 release.

Now all you need to have is the https://packagecontrol.io/packages/Jinja2 syntax.

predragnikolic commented 1 year ago

I will close this issue, but feel free to reopen it if you stumble upon any problem.