LuaLS / LuaLS/lua-language-server

Settings from client and .luarc.json not getting merged

未关闭
#2,483 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Lua
星标
4.4k
派生
442
PR 合并指标
30 天内没有已合并 PR

描述

How are you using the lua-language-server?

NeoVim

Which OS are you using?

Linux

What is the issue affecting?

Other

Expected Behaviour

Global settings from the client and local settings from the .luarc.json file should get merged. In my case I have the following .luarc.json:

{
	"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
  	"workspace.ignoreDir": ["test/xdg"]
}

There is no workspace.ignoreDir setting in my client config.

Actual Behaviour

The settings from .luarc.json are not applied. I have to add the ignoreDir setting to my client configuration for it to do something.

Reproduction steps

N/A

Additional Notes

I am testing a Neovim plugin (HiPhish/rainbow-delimiters.nvim), and the test setup requires me to place a symlink to the plugin root directory inside on of its sub-directories (rainbow-delimiters). When the language server starts scanning the plugin directory it ends up running in circles. Adding this directory to the ingoreDir list stops the infinite loop and the language server can scan all files normally.

I cannot place all my settings inside the local .luarc.json because the settings for Neovim configuration and plugin development cannot be known ahead of time, they must be generated. I can place the workspace.ignoreDir setting in my own client configuration, but this won't help people who want to contribute to my plugin.

What I need is for the language server to merge both configurations into one. The order should be from least to most significant:

  1. client configuration
  2. local configuration
  3. custom configuration file (maybe?)
Log File

file_home_hiphish_.local_share_nvim_site_pack_my-plugins_start_rainbow-delimiters.nvim.log

service.log

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先跟踪 language server 如何加载并合并客户端设置与 .luarc.json,重点关注 workspace.ignoreDir。使用附加的 logs 确认应用了哪个配置,以及合并在哪里停止。当客户端设置和本地设置遵循所要求的优先级,并且有一个 regression test 覆盖来自两个来源的 workspace.ignoreDir 时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
lua, neovim
领域
developer-experience, tooling
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。