EmmyLua-LanguageServer icon indicating copy to clipboard operation
EmmyLua-LanguageServer copied to clipboard

No completion of built-in modules

Open wbthomason opened this issue 5 years ago • 6 comments

I cannot get any completions from built-in modules (e.g. os, io, etc.). Completion works for tables I define, and most of the rest of the LS functionality works fine, so I don't think I have a configuration error. All that seems to fail is getting completions from these built-in modules. I'm using coc.nvim with the instructions given for EmmyLua-LS here: https://github.com/neoclide/coc.nvim/wiki/Language-servers#lua - am I missing something? Thanks!

wbthomason avatar Jul 06 '19 19:07 wbthomason

any updates?

I'v found the stdFolder option in LuaLanguageServer.kt, but it does not work:

call coc#config('languageserver.EmmyLua', {
        \   'command': &shell,
        \   'args': [&shellcmdflag, 'java -cp EmmyLua-LS-all.jar com.tang.vscode.MainKt'],
        \   'filetypes': ['lua'],
        \   'initializationOptions': {
        \     'stdFolder': 'path_to_this_repo/std/Lua54',
        \   },
        \ })

EDIT:

  • the stdFolder is the solution, but you must use file:// as prefix
  • I'v created a repo to make life easier: https://github.com/ZSaberLv0/EmmyLua_stdFolder

ZSaberLv0 avatar Jan 29 '21 02:01 ZSaberLv0

I just wanted to post that I am interested in this as well and would like for the server to handle the built-in modules. I am very appreciative of this project and all of the hard work this team has done. Thank you.

iqgrande avatar Feb 05 '21 20:02 iqgrande

there's a workaround, copy the contents of https://github.com/EmmyLua/IntelliJ-EmmyLua/tree/master/src/main/resources/std/Lua54 to your project (or to one of your project's sub dir)

but obviously that's not very convenient

ZSaberLv0 avatar Feb 06 '21 01:02 ZSaberLv0

any updates?

I'v found the stdFolder option in LuaLanguageServer.kt, but it does not work:

You need to specify it as a URI, e.g.

"stdFolder": "file:///C:/EmmyLua-LanguageServer/res/std"

maximryzhov avatar Feb 20 '21 22:02 maximryzhov

"stdFolder": "file:///C:/EmmyLua-LanguageServer/res/std"

it works!

ZSaberLv0 avatar Feb 21 '21 01:02 ZSaberLv0

How do I pass stdFolder to emmy in spacemacs on macos?

johalun avatar Jun 05 '21 15:06 johalun