LuaLS / LuaLS/lua-language-server

Incorrect folding range when a function with an inline comment follows an annotation

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

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

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ả

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows

What is the issue affecting?

Formatting

Expected Behaviour

The folding chevron will be next to the function declaration and will fold the function.

Actual Behaviour

The folding chevron is next to the annotation and will only fold the one line of the function, leaving the rest of the function unfolded.

Image
Image

Reproduction steps

This code reproduces it:
---@param bar integer function foo(bar) -- comment local whee = bar + 3 return whee end

Additional Notes

Removing the inline comment fixes it.
Putting a blank line between the annotation and the function declaration line, even if it still has the inline comment, fixes it.

Image
Image

Log File

I couldn't get the thing to upload it, I'm sorry :(

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 cách tái hiện hành vi folding với đoạn Lua trong issue, so sánh với các biến thể loại bỏ chú thích inline hoặc thêm một dòng trống. Theo dõi cách xử lý folding-range cho một annotation theo sau bởi một khai báo hàm. Hoàn tất khi chevron folding nằm bên cạnh khai báo hàm và fold toàn bộ phần thân hàm.

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
tooling
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/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.