LuaLS / LuaLS/lua-language-server
require path with custom package.loaders
まだ誰も着手していません。
- 主要言語
- Lua
- スター
- 4.4k
- フォーク
- 442
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
In my project I'm adding new package.loaders which means I'm able to import things that are not real files.
```lua
local bindings = require "bindings.core" -- This is not a real file
```
Any path starting with `bindings.` is treated differently. Is there a way to instruct the Lua Language Server to treat those specific requires in a special way and have them returning the right type annotation?
I'd like to not specify the @type every time I'm requiring these special packages.
```lua
---@type CoreBindings <---- I'm forced to specify the type
local bindings = require "bindings.core"
```
If there's a valid solution I'd need it to work outside of VS code. I'm running LuaLS as a standalone check.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Start by tracing how standalone LuaLS resolves require "bindings.core" and applies package.loaders information to type inference. Define how a configuration for the bindings. prefix would be supplied outside VS Code, then verify that the require receives CoreBindings without a repeated @type annotation.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- lua
- 領域
- devtools
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100