Documentation garbles backslashes, leading to incomprehensible examples

Aperta
#607 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
haskell
Ambito
documentation

Direzione di ricerca

Inizia confrontando la documentazione generata di Language-LSP-Server con il codice sorgente collegato di Language.LSP.Server.Core, concentrandoti su come il generatore della documentazione gestisce i backslash negli esempi di codice. Individua il percorso di escaping e verifica che gli snippet generati preservino la sintassi lambda in tutta la documentazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Consider, for example: https://hackage.haskell.org/package/lsp-2.7.0.1/docs/Language-LSP-Server.html#v:interpretHandler

The code snippet reads:

 ServerDefinition { ...
 , doInitialize = env _req -> pure $ Right env
 , interpretHandler = env -> Iso
    (runLspT env) -- how to convert from IO ~> m
    liftIO        -- how to convert from m ~> IO
 }

Making people wonder what strange new language extension syntax that may be. (Arrows perhaps?)

But looking at the source, it turns out, it is just lambdas:

  -- @
  --  ServerDefinition { ...
  --  , doInitialize = \env _req -> pure $ Right env
  --  , interpretHandler = \env -> Iso
  --     (runLspT env) -- how to convert from IO ~> m
  --     liftIO        -- how to convert from m ~> IO
  --  }
  -- @

It seems the backslashes got eaten due to an escaping mechanism in the documentation generator.

This is a problem throughout all of the documentation.

So I kindly ask if you could fix that, so it becomes understandable? :)


(BTW: I very much miss an actual guide on how to use this. A reference documentation is of course nice, but an actual guide/howto/intro, even if short, would make it possible to understand how it is meant to be used in its entirety. Not even the library and functions to start with is clear as it is, and must be dug up. Unfortunately this is a common problem with Haskell package documentation. Maybe while we’re at it, a quick thing could be added. haskell-language-server is really way too large to serve as an example for a beginner. :-/)

Lingua principale
Haskell
Stelle
426
Fork
107
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di haskell/lsp

Tutte le issue di haskell/lsp

Issue simili

Altre issue su Haskell

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.