Vim global object (or table) completion is approximate

Hello guys I have a question for you,

Right now I’m using NeoVim’s builtin LSP client and I followed (copied) the configuration on the official GitHub page to add Vim’s runtime to Lua so that you can have all those LSP goodies.

However I’ve noticed that even though I have a global vim object (or table should I say), it does show me the functions available but their type is “any”, and I need to require the single Lua files in /usr/share/nvim/runtime/lua to have the methods preview and documentation, i.e.

local shared = require('vim.shared')

will allow me to check shared module’s functions with the preview for the parameter, return type and documentation.

Am I missing something or is this the way it is supposed to work?

You may be interested in https://github.com/folke/lua-dev.nvim.

Thanks!

Even though I was reluctant about adding it, it seems that it’s the best way to have the least hassle.