LuaLS / LuaLS/lua-language-server
Lazy load workspace libraries
还没有人认领这个 Issue。
- 主要语言
- Lua
- 星标
- 4.4k
- 派生
- 442
- PR 合并指标
- 30 天内没有已合并 PR
描述
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?
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先跟踪 Lua.workspace.library 路径的加载方式,以及 require 语句补全如何查找匹配的文件。然后检查所需库何时可用于成员补全。完成的标准是:搜索库路径时无需在启动时加载每个文件,同时 require("foobar") 和 foobar.call_function 等补全仍然有效。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- lua, neovim
- 领域
- devtools, performance
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100