tailwind-tools.nvim icon indicating copy to clipboard operation
tailwind-tools.nvim copied to clipboard

Unknown function: TailwindGetUtilities

Open rickswe opened this issue 1 year ago • 2 comments

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):

  • Operating system - MacOS 15.0.1
  • Neovim version or commit NVIM v0.10.2 Build type: Release LuaJIT 2.1.1727870382
  • Nvim-treesitter commit latest as of 10/17/24
  • tailwind-language-server version ver:168

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

rickswe avatar Oct 18 '24 03:10 rickswe

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

luckasRanarison avatar Oct 31 '24 09:10 luckasRanarison

Hi there! I'm also encountering this issue with tailwind version 3.4.1. This is my current tailwind-tools config:

    {
        "luckasRanarison/tailwind-tools.nvim", -- tailwind helpers
        build = ":UpdateRemotePlugins",
        dependencies = {
            "nvim-treesitter/nvim-treesitter",
            "nvim-telescope/telescope.nvim",
            "neovim/nvim-lspconfig",
        },
        opts = {
            document_color = {
                kind = "inline",
                inline_symbol = "󰝤 ",
            },
        },
    },

Sadly even after running :UpdateRemotePlugins I still get the same error as mentioned in the issue when running :Telescope tailwind utilities.

Soryyyn avatar Aug 06 '25 08:08 Soryyyn