A vision for consistent static vs dynamic registration
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- haskell
- Ambito
- backend-api-design
Direzione di ricerca
Inizia leggendo inferServerCapabilities e l’handler initialize, poiché l’issue identifica entrambi come elementi centrali dell’attuale flusso di registrazione. Verifica come le registrazioni statiche e dinamiche potrebbero condividere i valori predefiniti delle capabilities e unire gli handler correlati, quindi conferma che le registrazioni statiche possono dipendere dalle capabilities del client. Il lavoro è completato quando il modello di registrazione è unificato senza l’attuale canale laterale Options.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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...)
- Lingua principale
- Haskell
- Stelle
- 426
- Fork
- 107
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di haskell/lsp
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 64/100
-
Optimize `instance Eq NormalizedFilepath`?!Forse già presa @sjakobi l’ha presa 381 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
-
Improve snippet sanitizationApertaZuriHac
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
haskell/bytestring#730 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
seal-harness/seal-harness#399 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
fmidue/codeworld-tasks#124 ·
-
allow haskell-src-exts-1.24Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
reflex-frp/reflex#563 ·