coc-lua icon indicating copy to clipboard operation
coc-lua copied to clipboard

How to append `vim.api.nvim_get_runtime_file('', true)` to Lua.workspace.library?

Open FalcoGer opened this issue 2 years ago • 1 comments

I don't want to manually adjust my workspace library whenever I install or remove a plugin. Luckily vim.api.nvim_get_runtime_file('', true) produces all the paths that nvim's lua interpreter looks for libraries for. Unfortunately the settings in the coc-configurations are done with a json file and there is no syntax to do a function call there to populate any options, as far as I could gather. Is there some way to put all those paths into Lua.workspace.library in a different way? Maybe some special string?

FalcoGer avatar Nov 17 '23 17:11 FalcoGer

From what I found, you can leverage coc#config to change the configuration at runtime (or use g:coc_user_config). This works for me:

vim.cmd([[
  autocmd FileType lua call coc#config('Lua.workspace.library', nvim_get_runtime_file('', 1))
]])

jakubfijalkowski avatar Feb 04 '24 11:02 jakubfijalkowski