Stalls for large number of LSP completion items

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

To reproduce:

  • Clone repository: GitHub - alex-ketch/Nova-Tailwind-LSP
  • Run npm install
  • Open project in Nova
  • From Menu bar select ExtensionsActivate 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)

Hello!

Sorry for the late reply. I’ll look into investigating why this might be slowing down so badly. 9k items is a lot, I agree, and ideally the tailwind LSP server wouldn’t be sending that much, but theoretically Nova should be able to handle it.

The JSON error is also unexpected. Hopefully that’s easy to fix.

Logan

1 Like