lua-language-server icon indicating copy to clipboard operation
lua-language-server copied to clipboard

search path is not change for the require command whn i configure the relative extension's paths

Open konstantinosDMS opened this issue 1 year ago • 0 comments

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Linux

What is the issue affecting?

Libraries

Expected Behaviour

I wrote the following code: local cjson = require 'posix.unistd' print(type(cjson)) a = {} print("aaaa") from command line it is running perfectly my LUA_PATH = /usr/local/share/lua/5.4/?.lua;/usr/local/share/lua/5.4/?/init.lua;/usr/local/lib/lua/5.4/?.lua;/usr/local/lib/lua/5.4/?/init.lua;./?.lua;./?/init.lua my LUA_CPATH = /usr/local/lib/lua/5.4/?.so;/usr/local/lib/lua/5.4/loadall.so;./?.so LUA Runtime setting for the extension is as:

?.lua
?/init.lua
/usr/local/share/lua/5.4/?.lua;
/usr/local/share/lua/5.4/?/init.lua;
/usr/local/lib/lua/5.4/?.lua;
/usr/local/lib/lua/5.4/?/init.lua;
./?.lua;
./?/init.lua

LUA workspace library /usr/local/lib/lua/5.4/?.so; /usr/local/lib/lua/5.4/loadall.so; ./?.so when i am running or debugging the program it still searches the workspace folder, any suggestion?

Actual Behaviour

It should change the searching directory prior running to .so paths

Reproduction steps

  1. Go to '...'
  2. code editor
  3. write an include statement
  4. Click '...'
  5. run or debug
  6. See error '...'
  7. module 'posix.unistd' not found: no field package.preload['posix.unistd'] no file '/home/konstantinos/Desktop/server/lua-apps/posix/unistd.lua' no file '/home/konstantinos/Desktop/server/lua-apps/posix/unistd.lua' no file '/home/konstantinos/Desktop/server/lua-apps/posix/unistd.so' no file '/home/konstantinos/Desktop/server/lua-apps/posix/unistd.so' no file '/home/konstantinos/Desktop/server/lua-apps/posix.so' no file '/home/konstantinos/Desktop/server/lua-apps/posix.so'

Additional Notes

error loading module 'posix.unistd' from file '/usr/local/bin/lua': /usr/local/bin/lua:1: unexpected symbol near '<\127>'

Log File

No response

konstantinosDMS avatar Oct 30 '23 20:10 konstantinosDMS