A vision for consistent static vs dynamic registration
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
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- haskell
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Bắt đầu bằng cách đọc inferServerCapabilities và handler initialize, vì issue xác định cả hai là thành phần trung tâm của luồng đăng ký hiện tại. Tìm hiểu cách các đăng ký tĩnh và động có thể dùng chung các giá trị mặc định của capability và hợp nhất các handler liên quan, sau đó xác nhận rằng các đăng ký tĩnh có thể phụ thuộc vào capabilities của client. Công việc được xem là hoàn tất khi mô hình đăng ký được thống nhất mà không cần kênh phụ Options hiện có.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
At the moment static versus dynamic registration works quite differently.
Specifically:
- When you register a method dynamically, you have to provide the
RegistrationOptions - When you register a method statically, you don't have to provide the
ServerCapability(from https://github.com/haskell/lsp/pull/581)- Instead, we try to infer the appropriate capability. See
inferServerCapabilities - But, this requires a bunch of choices that we can't guess! So we put in a side channel in the form of
Options, which basically lets us pass in things that need to go in the capabilities.
- Instead, we try to infer the appropriate capability. See
I think we could unify these. Specifically, I think we should make the user provide the capability in both cases. That means that we don't need to pass the extra information out-of-band in Options, instead the user can just set things in the capability directly.
Of course, we probably want a way to provide a sensible default capability... but we also want this for the dynamically registered capabilities! So we should try and provide this for everything.
The main complication is that for both static and dynamic registration we may need to register several method handlers under the same capability, and what the capability is will depend on all of them. For example:
textDocument/completionandcompletionItem/resolve. The latter is not registered separately, but is rather indicated by a field in the completion capability.textDocument/semanticTokens/fulland the other semantic tokens methods. Similar.
I think we can do this reasonably nicely by pretending that we can register everything independently, and then merging all the capabilities when we actually do the registration. So for example, we might have a default capability for the textDocument/completion handler that doesn't say it supports resolve, and then a capability for completionItem/resolve that says it supports resolve, and then we merge those together into the final capability that we register. I think this should work for both static and dynamic capabilities.
So I think we want something like this:
-- We might not be able to have these actually instances due to singletons stuff, but morally we want them
instance Semigroup (ServerCapability m)
instance Semigroup (ClientCapability m)
instance Semigroup (RegistrationOptions m)
type StaticRegistration m = (Handler m, ServerCapability m)
type DynamicRegistration m = (Handler m, RegistrationOptions m)
We probably also need the server definition to tell us its static registrations as part of the initialize handler instead of beforehand. This is necessary anyway, since you might need to decide whether to use static or dynamic registration depending on the client's capabilities.
(It would also be nice if we could provide a relatively simple way to have a handler that is either statically or dynamically registered depending on whether the client supports dynamic registration...)
- 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 382 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 ·