LuaLS / LuaLS/lua-language-server

[Feature Request] Multiple-project/Monorepo support

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

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

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

説明

I work with a large monorepo that contains multiple Lua project roots. You can actually see the list of Lua projects here, as an example: https://github.com/SmartThingsCommunity/SmartThingsEdgeDrivers/tree/main/drivers/SmartThings

Loading this entire repo at once doesn't work well because of how the require paths are established via runtime.path. The primary issue is that it leads to ambiguous require resolution if two of the roots have files with the same name.

Obviously, one workaround is to use a multi-root workspace and only add the folders for the projects I currently care about, but that's tedious since I'd be adding and removing folders from the workspace constantly.

One idea that I had was being able to specify an "entrypoint" glob. The plugin could traverse up the directory tree looking for a file that matches the glob, and then use that as the root for all local requires. But that might not be a good "general" solution even though it works well for my use case.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

まず、runtime.path がローカルの require ルートをどのように設定するか、またリポジトリに複数の Lua プロジェクトルートが含まれている場合にどのように動作するかを確認します。issue では可能な方向性の 1 つとして entrypoint glob が示されていますが、推奨する設計や変更対象のファイルは指定されていません。完了とは、曖昧な require 解決なしに monorepo を読み込めることを意味します。

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

評価

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

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

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