Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Plenary's global `busted` definitions get picked up by LuaLS

オープン
#593 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
lua
領域
testing, tooling

調査の方向性

Start by locating Plenary's bundled busted implementation and the global assignments it exposes, then reproduce how LuaLS indexes those definitions. Decide on a solution that prevents the bundled globals from being selected while preserving existing plugin behavior; done means real busted definitions are used for navigation without breaking Plenary tests.

索引モデルが issue の本文から書いたものです。

説明

Hello.

Plenary has its own implementation of busted, and just like the real busted it defines a bunch of global variables. This is a problem when using LuaLS because these definitions will be added to the global namespace even if I never require their source file because LuaLS sees a global assignment and adds the variable regardless of whether the file is ever sourced. I use the real busted for my tests, so this means that jumping to the definition will jump to the wrong functions.

How can we fix this? I can think of two solutions:

  • Use string variables and indices to assign to _G, i.e. instead of describe = mod.describe use local name = 'describe'; _G[name] = mod.describe, this will stop the language server from adding the definition.
  • Move the plenary busted functionality to a separate plugin that plugin authors can packadd before running tests. Then I don't have to install the plenary busted plugin and everything is fine.

Personally I think the second option would be better because it does not disrupt any existing plugins that depend on it, but it is a bit uglier in the code. What do you think? Any other idea?

主要言語
Lua
スター
3.5k
フォーク
340
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nvim-lua/plenary.nvim のほかの issue

nvim-lua/plenary.nvim の issue をすべて見る

似ている issue

Lua の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。