LuaLS / LuaLS/lua-language-server

[Feature Request] Multiple-project/Monorepo support

Đang mở
#2,962 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

enhancement
Ngôn ngữ chính
Lua
Star
4.4k
Fork
442
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu bằng việc xem xét cách runtime.path thiết lập các thư mục gốc require cục bộ và cách hoạt động này diễn ra khi repository chứa nhiều thư mục gốc của dự án Lua. Issue đề xuất entrypoint glob như một hướng có thể thực hiện, nhưng không chỉ rõ design được ưu tiên hay các file cần thay đổi. Hoàn tất nên có nghĩa là có thể tải monorepo mà không xảy ra việc phân giải require không rõ ràng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
lua
Lĩnh vực
developer-experience, tooling
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
32/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.