luckasRanarison / tailwind-tools.nvim

An unofficial Tailwind CSS integration and tooling for Neovim
https://dotfyle.com/plugins/luckasRanarison/tailwind-tools.nvim
MIT License
387 stars 16 forks source link

Unknown function: TailwindGetUtilities #60

Open rickalex21 opened 4 weeks ago

rickalex21 commented 4 weeks ago

Describe the bug

When running Telescope tailwind utilties I get this error:

Error executing Lua callback: Vim:E117: Unknown function: TailwindGetUtilities                                                                                    
stack traceback:                                                                                                                                                  
        [C]: in function 'fn'                                                                                                                                     
        .../lazy/tailwind-tools.nvim/lua/tailwind-tools/rplugin.lua:9: in function 'get_utilities'                                                                
        ...ilwind-tools.nvim/lua/telescope/_extensions/tailwind.lua:26: in function <...ilwind-tools.nvim/lua/telescope/_extensions/tailwind.lua:25>              
        ...im/vanilla/lazy/telescope.nvim/lua/telescope/command.lua:183: in function 'run_command'                                                                
        ...im/vanilla/lazy/telescope.nvim/lua/telescope/command.lua:259: in function 'load_command'                                                               
        .../neovim/vanilla/lazy/telescope.nvim/plugin/telescope.lua:108: in function <.../neovim/vanilla/lazy/telescope.nvim/plugin/telescope.lua:107>      

To Reproduce

Use my config:

local custom = require "my.custom"

---@type LazyPluginSpec
return {
  "luckasRanarison/tailwind-tools.nvim",
  build = ":UpdateRemotePlugins",
  lazy = true,
  init = function()
    vim.api.nvim_create_autocmd("LspAttach", {
      callback = function(args)
        local client = vim.lsp.get_client_by_id(args.data.client_id)
        if client and client.name == "tailwindcss" then
          require "tailwind-tools"
          return true
        end
      end,
    })
  end,
  opts = {
    conceal = {
      symbol = "…",
    },
  },
  config = function(_, opts)
    require("tailwind-tools").setup(opts)
    custom.cmp_format.before = require("tailwind-tools.cmp").lspkind_format
  end,
}

Then run :Telescope tailwind utilities on a react project with tailwind.

Expected behavior

No error.

Screenshots See error above

Environment (please complete the following information):

I also installed neovim in the project with npm install neovim. I am getting this message from UpdateRemotePlugins:

function remote#host#UpdateRemotePlugins[6]..<SNR>57_RegistrationCommands[13]..remote#host#RegisterPlugin, line 5                                                 
Plugin "/Users/ritchie/.local/share/neovim/vanilla/lazy/tailwind-tools.nvim/rplugin/node/tailwind-tools" is already registered                                    
remote/host: generated rplugin manifest: /Users/ritchie/.local/share/neovim/vanilla/rplugin.vim 

Thanks

luckasRanarison commented 2 weeks ago

Sorry for the late reply. Does it still happen after running :UpdateRemotePlugins?