Automatically downgrade responses in order to match client capabilities
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
Issue không nêu tên tệp, bài kiểm thử hoặc entry point cụ thể nào; hãy bắt đầu bằng việc xác định các kiểu response và phần xử lý capability của client trong thư viện Haskell. Xác định phạm vi của một downgrader tổng quát, bao gồm các trường không được hỗ trợ, các phép chuyển đổi như từ InsertReplaceTextEdit sang TextEdit và các cảnh báo khi không thể thực hiện chuyển đổi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Many specification features take the form of optional additional fields on responses. This means that so long as clients ignore fields they don't recognize or handle, servers can be fairly lax about checking the client capabilities when they return responses.
However:
- Sometimes you can't do this at all. An
InsertReplaceTextEditis not a subclass of aTextEdit, so a client that doesn't supportInsertReplaceTextEdits will probably just fail if you send it one. - Sometimes you lose information this way. If you have populated the
labelDetailsfield for aCompletionItem, you might lose useful information for the user if it is just dropped, which otherwise you might have put into thelabel. - It's just a bit ugly to send stuff that the client doesn't understand, and we it's not easy to notice this (previously: https://github.com/haskell/lsp/issues/306).
But doing better currently relies a lot of discipline to check the client capabilities everywhere and have lots of branching logic.
So here's an idea: provide a way to automatically downgrade a response to match the client capabilities. In many cases this will be trivial: drop the unsupported fields. But in other cases we can do a translation that does its best to carry on as much information as possible: turn an InsertReplaceTextEdit into a TextEdit by taking the insertion edit; drop labelDetails by adding it to the label, etc. And if we can't do anything we can perhaps emit a warning.
Take that, stick it in a typeclass, and then we can give people a generic downgrader that they can stick onto the end of their handlers to ensure they get appropriate output.
- Ngôn ngữ chính
- Haskell
- Star
- 426
- Fork
- 107
- 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
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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 haskell/lsp
-
Unused build depdency on regexĐang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
-
Optimize `instance Eq NormalizedFilepath`?!Có thể đã có người làm @sjakobi đã nhận 381 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
-
Improve snippet sanitizationĐang mởZuriHac
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/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 72/100
haskell/bytestring#730 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
seal-harness/seal-harness#399 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
add previously overlooked rulesĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
fmidue/codeworld-tasks#124 ·
-
allow haskell-src-exts-1.24Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
reflex-frp/reflex#563 ·