Open Ultra-Instinct-05 opened 2 years ago
Introducing logic to detect whether it's possibly a tailwind project or not would not be great from the standpoint of maintainability. Something like that was implemented here before but was eventually removed (#35).
I would suggest that you just override the selector
either per-project or even in global LSP-tailwincss settings if you don't expect to be using it with php projects.
I clearly see it as a bug. If a server has nothing to do with the project, it should not spin a new process. In the example, the folder has just some PHP files and nothing to do with Tailwind. Other servers don't start in workspaces that have nothing to do with them. I am not sure whether it's a client or a server problem here.
But we don't want to duplicate the logic of the language server that detects whether the project is using tailwindcss or not. And for the server to detect whether the project uses tailwindcss, it needs to be started.
It might be just better to disable LSP-tailwindcss globally and enable it per-project.
So can't the server stop if it detects that the project is not related to TW CSS ?
I believe that spec-wise there is no way for LSP server to request it to be shut down and its lifetime is controlled by the LSP client.
I just have a simple PHP folder with no
tailwind.config.js
and yet the tailwind css server seems to spin up. I guess if there is nothing related to tailwind in the folder, don't start the server ?