sublimelsp / LSP-tailwindcss

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

Does it work with Just-In-Time mode enabled? #22

Closed jnns closed 2 years ago

jnns commented 2 years ago

It seems to me that the suggestions don't work when JIT mode is enabled. Which makes sense to me if the LSP plugin actually takes the suggestions out of the generated file, because with JIT enabled there wouldn't be any classes to suggest except the ones already used.

If that's the case, should it be mentioned in the Readme file?

predragnikolic commented 2 years ago

I haven't yet used the JIT mode, so I can't provide a helpful answer now, until I dig into it a bit more.

Do you mind opening an issue at https://github.com/tailwindlabs/tailwindcss-intellisense ? (maybe someone already had similar issues as you)

jnns commented 2 years ago

Thank you, Предра.

I was able to find this comment in tailwindcss-intellisense issue tracker:

bradlc: The extension already supports JIT mode +1

Although I have no idea how it would work and where suggestions could be sourced from if they are not generated beforehand.

predragnikolic commented 2 years ago

If you could create a repro repo with the bug that could be helpful.

davidwebca commented 2 years ago

I use JIT exclusively since it was released and I sometimes have them and sometimes don't. It would make sense to be because it look in the generated files. But also, my generated files are git ignored since I use SCSS (dist folder ignored to only track SCSS files) and when a dist folder is ignored, Sublime kinda scoffs over it and doesn't look at the files anymore somehow (they're not tracked in search, they're grayed out in the sidebar, etc.)

I've been meaning to pin down the source of the inconsistencies, especially when booting up Sublime (most lsp servers don't start right away unless I mess up with their config files, even using the restart servers command doesn't do anything).

predragnikolic commented 2 years ago

I managed to get completions with JIT mode.

image

I will need a repro repo.

predragnikolic commented 2 years ago

Question, @jnns did you run npm i in the project? Becase you need to have tailwindcss installed in node_modules in order for LSP-tailwindcss to work.

jnns commented 2 years ago

Weird. Now it also works on my machine without me changing anything on the setup. 🥳 I was always using tailwindcss as a PostCSS plugin through postcss-cli. It must have been one of those inconsistencies that @davidwebca mentioned.

Bildschirmfoto vom 2021-10-11 21-04-01

Thanks for looking into it and spending your time on this.