-
Notifications
You must be signed in to change notification settings - Fork 87
TailwindCSS Language Server compatibility #251
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
Conversation
|
I've updated this so we're not relying on the users ignorecase setting. |
|
This seems like a bug in the server but it's hard to know for sure. My reading of the spec doesn't allow the server to do this. The server doesn't appear to have source code published anywhere and there is no issue tracker I can find. Thanks to a typo I can tell that it's using this code: https://github.com/microsoft/vscode-languageserver-node/blob/2d72432e59a83c45e6a8093ba51d097fa9ea7216/jsonrpc/src/messageWriter.ts#L67 I don't see anything there that looks like it would insert an arbitrary This does seem fairly safe, but it always makes me nervous to add a hack for a bug in some server. Does this happen consistently for every message, or does it only happen occasionally? If it only happens on the first message, for instance, maybe there is some other initial behavior allowed by the spec that we should be accounting for elsewhere. |
|
What does your server config look like so I can try to reproduce this? |
|
After installing the server with |
|
Here's the config I'm using: If I revert the change, autocomplete no longer works for Without suppressing stderr I get the following messages: The [] at the beginning of headers seems pretty consistent, the project I'm reproducing this on is a 3 file style.css/index.html/plain tailwind.config.js so it's about as simple as can be. Let me know if you need any more information, I'd rather not add hacks to fix a bug in another project either. |
|
I can reproduce the issue using the first example from the tailwindcss screecasts github repo here: |
|
Thanks for the specific example, I am able to see the I don't think the fix here is the right thing to do - if we do anything at all it should probably be to handle errant content before the first message, rather than on every header. It should also handle a non-empty array - I don't know enough about the server to know if I strongly suspect that this is an unintentional bug in the server - A My inclination here is to avoid any changes in the plugin with the assumption that the server author will be willing to fix the bug. If that's not the case let me know and I can look again at how to handle it in a hopefully more robust way, perhaps by throwing away lines that end in |
|
If you're inclined to hack around this in another way, you could find the server file and edit it - it is minified, but you should be able to find and delete the |
|
Thanks for your time and detailed feedback, I'll follow up with the author and let you know. |
|
No news yet from tailwindlabs/tailwindcss-intellisense#91 Just letting you know I'm still chasing, hopefully will hear something soon 👍 |
Hi Nate,
I've been trying to use the
tailwindcss-language-server, the following snippet fixes it to work with vim-lsc.The problem seems to be that the headers passed from the language server begins with an array e.g:
With the included if statement this gets removed, resulting in:
I checked another server,
typescript-language-serverto make sure the change didn't break a previously working example.I looked for some contributor guidelines but found none, I'd love to help get this working for other people.