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 摘要。