-
Notifications
You must be signed in to change notification settings - Fork 197
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
Use one server to handle all folders in a workspace #957
Conversation
It makes more sense for our server to ask for them like we do all other config options rather than expecting them to be passed in during initialization
This is a bit of a behavioral change but if _any_ folder in your current workspace might need the language server when we’ll boot it. We do still wait for an open document currently.
@alexander-doroshko I'm landing a change here that will have the server ask for "user languages" from the config rather than from initialization options. We have an existing setting for this that we use populate the initialization options in our extension: Would this cause any problems with jet brains stuff? Right now it'll still fall back to initialization options so it shouldn't break if none are defined in the config but it's likely I'll remove that in the near future. |
JetBrains :)
Do you mean the server will ask "method": "workspace/configuration",
"params": {
"items": [
{
"section": "tailwindCSS"
}
]
} and the IDE is expected to answer with "result": [
{
"includeLanguages": {
"ftl": "html",
"jinja": "html",
"jinja2": "html",
"smarty": "html",
"tmpl": "gohtml",
"cshtml": "html",
"vbhtml": "html",
"razor": "html"
},
"files": {
"exclude": [
"**/.git/**",
"**/node_modules/**",
"**/.hg/**",
"**/.svn/**"
]
},
"emmetCompletions": false,
"classAttributes": [
"class",
"className",
"ngClass"
],
"colorDecorators": false,
"showPixelEquivalents": true,
"rootFontSize": 16,
"hovers": true,
"suggestions": true,
"codeActions": true,
"validate": true,
"lint": {
"invalidScreen": "error",
"invalidVariant": "error",
"invalidTailwindDirective": "error",
"invalidApply": "error",
"invalidConfigPath": "error",
"cssConflict": "warning",
"recommendedVariantOrder": "warning"
},
"experimental": {
"classRegex": []
}
}
] ? |
Dammit — my autocorrect screwed this one up :D — I'll have to add a shortcut to fix that.
Yup, exactly. |
Cool, thanks, this is what our Tailwind CSS plugin already does. Anyway, we'll check everything once again when we are updating the bundled Tailwind CSS LSP server. Please ping me somehow when you publish a new version to https://www.npmjs.com/package/@tailwindcss/language-server. For example, by email |
Excellent — good to know! And will do! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- When running
prettier --write .
I do get some changes in files
Built a local vsix file and everything still seems to work!
It’ll need to come back once I upgrade TypeScript
Previously, if your workspace had multiple folders, we would boot a separate server per workspace folder. This was because our server didn't support workspace folders. However, it now does which means we can make use of this feature.
This change should help reduce CPU and memory usage in any workspace making use of multiple folders. This will also solve an issue where Intellisense would not load when a workspace that is open is a subdirectory of another workspace, the subdirectory folder was listed first, and that subdirectory didn't contain a tailwind config or tailwind-related CSS file.
Fixes #921