Crash On Unrecognized CompletionItemKind
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
La issue punta a lsp-types/src/Language/LSP/Types/Completion.hs e alla relativa dichiarazione A.FromJSON per CompletionItemKind. Inizia riproducendo il fallimento di decodifica di initialize riportato nel log allegato e traccia come vengono gestiti i valori di enumerazione sconosciuti. Il lavoro è completato quando una richiesta initialize contenente None o altri Completion Kinds sconosciuti non causa più un crash e questo caso è coperto dai test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I am attempting to build a language client against haskell-language-server in Visual Studio 2019.
When I follow the instructions for doing so however, haskell-language-server-wrapper fails with the following error
2022-09-24T11:34:34.192704Z | Info | Starting server
2022-09-24T11:34:34.193704Z | Error | Got error while decoding initialize:
Error in $.params.capabilities.textDocument.completion.completionItemKind.valueSet[0]: CompletionItemKind
Upon further investigation, it seems the issue is that in the CompletionItemKind enumeration defined in Microsoft.VisualStudio.LanguageServer.Protocol.dll, the first element of this enumeration is None. Visual Studio attempts to pass all members of this enumeration as supported completion kinds to the language server. In the A.FromJSON declaration, None is not a valid identifier, resulting in fail "CompletionItemKind" being called, which I believe is what leads to the exception above.
According to the LSP Specifiaction:
To support the evolution of enumerations the using side of an enumeration shouldn’t fail on an enumeration value it doesn’t know. It should simply ignore it as a value it can use and try to do its best to preserve the value on round trips. Lets look at the CompletionItemKind enumeration as an example again: if in a future version of the specification an additional completion item kind with the value n gets added and announced by a client a (older) server not knowing about the value should not fail but simply ignore the value as a usable item kind.
There are actually 13 "additional" values in the CompletionItemKind enum of Microsoft.VisualStudio.LanguageServer.Protocol.dll, so I believe the key issue here is that haskell/lsp (and by extension haskell-language-server) do not correctly ignore unknown enumeration values as recommended by the LSP specification. This may potentially affect other LSP enumeration kinds implemented by this project as well
Attached is the log output of haskell-language-server-wrapper that generated this error
- 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 ·