Documentation garbles backslashes, leading to incomprehensible examples

オープン
#607 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
42/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
haskell
領域
documentation

調査の方向性

まず、生成された Language-LSP-Server ドキュメントとリンク先の Language.LSP.Server.Core ソースを比較し、ドキュメントジェネレーターがコード例内のバックスラッシュをどのように扱うかに注目します。エスケープの経路を特定し、生成されたスニペットでドキュメント全体を通してラムダ構文が保持されていることを確認します。

索引モデルが issue の本文から書いたものです。

説明

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. :-/)

主要言語
Haskell
スター
426
フォーク
107
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

haskell/lsp のほかの issue

haskell/lsp の issue をすべて見る

似ている issue

Haskell の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。