LuaLS / LuaLS/lua-language-server

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

Đang mở
#2,398 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Lua
Star
4.4k
Fork
442
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện hành vi của extension LuaLS VS Code trên Linux với các giá trị LUA_PATH và LUA_CPATH được báo cáo, sau đó so sánh các đường dẫn đã cấu hình với các đường dẫn mà require sử dụng cho posix.unistd. Được xem là hoàn tất khi extension hoặc runtime sử dụng các đường dẫn thư viện dùng chung đã cấu hình thay vì chỉ tìm kiếm trong thư mục workspace.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
lua
Lĩnh vực
tooling
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.