CosmicNvim / CosmicNvim

CosmicNvim is a lightweight and opinionated Neovim config for web development, specifically designed to provide a đź’« COSMIC programming experience!

Home Page:https://cosmicnvim.vercel.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to add tailwindcss autocompletion?

siliconsocket opened this issue · comments

Hi, thanks for the hard work!

I'm very happy using cosmic, but I have a problem: I need to implement tailwindCSS server,
after customizing my CosmicNvim, I found an error, I tried with

:LspInstall tailwindcss

after doing this and running:

:CosmicReloadSync

I got the following error:

Error executing vim.schedule lua callback: ...l/Cellar/neovim/0.6.0/share/nvim/runtime/lua/vim/lsp.lua:887: RPC[Error] code_name = InternalError, messa ge = "Request initialize failed with message: Cannot read property 'hover' of undefined" stack traceback: [C]: in function 'assert' ...l/Cellar/neovim/0.6.0/share/nvim/runtime/lua/vim/lsp.lua:887: in function 'cb' vim.lua:285: in function <vim.lua:285> Press ENTER or type command to continue

I tried adding configuration as example recommends, installed npm module for tailwindcss intellisense, :checkhealth it's ok. But I can't solve this issue.
I added another plugins with success, but I can't with tailwindcss

I'll be glad if someone can give me an orientation or path to follow,

Thank you in advance.

Issue was related to this neovim/nvim-lspconfig#1504

I solved it adding classAttributes in config as follows:

  sumneko_lua = {
    format = false, -- disable formatting all together
  },
  html = true,
  tsserver = {
    format = false, -- disable formatting all together
  },
  tailwindcss = {
    opts = {
      settings = {
        tailwindCSS = {
          classAttributes = { 'class' , 'className' , 'classList' }
        }
      }
    }
  }
},`