LuaLS / LuaLS/lua-language-server
Undefined global: vim, hs, mp, anything implicitly defined by a parent
まだ誰も着手していません。
- 主要言語
- Lua
- スター
- 4.4k
- フォーク
- 442
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
How are you using the lua-language-server?
NeoVim
Which OS are you using?
MacOS
What is the issue affecting?
Diagnostics/Syntax Checking
Expected Behaviour
LuaLS should have an annotation to assume a global is already defined. I looked in the documentation and didn't see one, but correct me if I'm wrong.
Actual Behaviour
In Neovim, vim is defined as a global in the Lua init file, which LuaLS complains about. This is frequently worked around by adding it as a global setting to LuaLS, but imo this is a monkey patch because non-Neovim Lua code may benefit from a diagnostic for a missing vim global.
It also doesn't help for other programs that embed Lua and define their own globals. HammerSpoon defines hs and mpv defines mp. In these cases the diagnostic can be circumvented with a require but it's not idiomatic in these domains and doesn't work for Neovim.
Reproduction steps
- Edit NeoVim, HammerSpoon, or mpv script
- Add
vim,hs, ormpto the respective script - Run LuaLS on the script
Additional Notes
No response
Log File
No response
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
ソースファイルやテストは指定されていません。まず LuaLS の診断と既存のグローバル設定の構成を追跡し、次に親から提供されるグローバル変数をどのように宣言すべきかを判断してください。Neovim、Hammerspoon、mpv のグローバル変数を、関係のない名前に対する undefined-global 診断を抑制せずに認識できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- lua
- 領域
- devtools
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100