I’m trying to write an LSP extension to integrate with the Tailwind CSS LSP but am facing a persistent issue of Nova freezing up when trying to trigger a completion.
The draft version of the extension can be found here: GitHub - alex-ketch/Nova-Tailwind-LSP: ⚠️ WIP — Not ready for use
To reproduce:
- Clone repository: GitHub - alex-ketch/Nova-Tailwind-LSP: ⚠️ WIP — Not ready for use
- Run
npm install
- Open project in Nova
- From Menu bar select
Extensions
→Activate Project as Extension
- Open one of the test files in
/test
directory - Try to type inside the
className
attribute or after the@apply text-base
directive - See infinity spinning beach ball
Current hypothesis based on quote below is that Tailwind returns many thousands of completion options, overwhelming Nova.
tailwindcss server always returns the 9k items
- high ram and cpu usage with tailwindcss
Few other observed errors in the Debug console:
-32601 Unhandled method textDocument/codeAction
- The following
dataCorrupted
error:
Unhandled exception: dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "params", intValue: nil), CodingKeys(stringValue: "registrations", intValue: nil)], debugDescription: "Could not decode registration with id 94bd06b3-4969-4317-bc3a-13fdf56a162d, method \"textDocument/documentColor\".", underlyingError: nil))
Error: dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "params", intValue: nil), CodingKeys(stringValue: "registrations", intValue: nil)], debugDescription: "Could not decode registration with id 94bd06b3-4969-4317-bc3a-13fdf56a162d, method \"textDocument/documentColor\".", underlyingError: nil))
at Ft (/Users/ketch/Play/Nova/TailwindCSS LSP.novaextension/node_modules/@tailwindcss/language-server/bin/tailwindcss-language-server:139:236)
at ge (/Users/ketch/Play/Nova/TailwindCSS LSP.novaextension/node_modules/@tailwindcss/language-server/bin/tailwindcss-language-server:138:6875)
at Immediate.<anonymous> (/Users/ketch/Play/Nova/TailwindCSS LSP.novaextension/node_modules/@tailwindcss/language-server/bin/tailwindcss-language-server:138:6722)
at process.processImmediate (node:internal/timers:471:21)