LuaLS / LuaLS/lua-language-server
Lazy load workspace libraries
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ả
I'm using sumneko_lua with Neovim and I wanted to have completions from the Lua plugins I have installed, so I inserted all the paths to the plugins that I have into Lua.workspace.library
But the problem is that it that sumneko_lua loads all the files inside those libraries right on startup, causing a massive increase to my RAM usage. Normally sumneko_lua only takes up 100-200 MB, but after adding 40+ library paths, sumneko now takes up to 600-700 MB.
Is it possible to load the libraries into the workspace, only when it is needed?
For example, I don't believe the library needs to be loaded when you're only completing a require statement:
local foobar = require("foob|
sumneko_lua only needs to scan the directories listed in Lua.workspace.library to find the correct files.
Once the require statement is completed, and its return value is interacted with:
local foobar = require("foobar")
foobar.call_functi|
sumneko_lua can now then load the library in order to produce the completions.
Is it possible for something like this to be implemented?
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- 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 theo dõi cách các đường dẫn Lua.workspace.library được tải và cách tính năng hoàn thành câu lệnh require tìm các tệp phù hợp. Sau đó, kiểm tra thời điểm thư viện được yêu cầu trở nên khả dụng cho tính năng hoàn thành thành viên. Công việc được xem là hoàn tất khi các đường dẫn thư viện được tìm kiếm mà không tải mọi tệp lúc khởi động, trong khi các nội dung hoàn thành như require("foobar") và foobar.call_function vẫn hoạt động.
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, neovim
- Lĩnh vực
- devtools, performance
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100