nvim-plugin-template icon indicating copy to clipboard operation
nvim-plugin-template copied to clipboard

Document how to let the lua LSP find local libraries, such as plenary

Open Murderlon opened this issue 1 year ago • 5 comments

This template is great, it saved a lot of time.

There is just one thing I don't understand, which is how to make lua_ls (language server for lua) understand where to find the code for plenary. By default plenary is put into /tmp.

I tried to create a .luarc.json to find it but I failed:

{
  "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
  "diagnostics.globals": ["describe", "it"],
  "workspace.library": ["?.lua", "?/init.lua", "/tmp/plenary.nvim/lua/plenary/?.lua"]
}

Since the docs of plenary are so limited and the LSP doesn't know anything about the available methods and imports of plenary, it's quite hard to develop locally.

Murderlon avatar May 12 '23 13:05 Murderlon