Plenary's global `busted` definitions get picked up by LuaLS
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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 ofdescribe = mod.describeuselocal 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
packaddbefore 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?
- Ngôn ngữ chính
- Lua
- Star
- 3.5k
- Fork
- 340
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nvim-lua/plenary.nvim
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
nvim-lua/plenary.nvim#682 ·
-
uniform usage of `os.getenv`Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
nvim-lua/plenary.nvim#680 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
nvim-lua/plenary.nvim#675 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 28/100
nvim-lua/plenary.nvim#672 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
nvim-lua/plenary.nvim#671 · 1 bình luận ·
Tất cả issue của nvim-lua/plenary.nvim
Issue tương tự
-
Zenmap CrashĐang mởZenmap
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
solana-foundation/pay-kit#341 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100