Automatically downgrade responses in order to match client capabilities
まだ誰も着手していません。
評価
調査の方向性
この issue では具体的なファイル、テスト、エントリポイントが指定されていません。まず、Haskell ライブラリ内のレスポンスタイプとクライアント能力の処理箇所を特定してください。未対応フィールド、InsertReplaceTextEdit から TextEdit への変換のような変換、および変換できない場合の警告を含め、汎用ダウングレーダーの範囲を定義してください。
索引モデルが issue の本文から書いたものです。
説明
Many specification features take the form of optional additional fields on responses. This means that so long as clients ignore fields they don't recognize or handle, servers can be fairly lax about checking the client capabilities when they return responses.
However:
- Sometimes you can't do this at all. An
InsertReplaceTextEditis not a subclass of aTextEdit, so a client that doesn't supportInsertReplaceTextEdits will probably just fail if you send it one. - Sometimes you lose information this way. If you have populated the
labelDetailsfield for aCompletionItem, you might lose useful information for the user if it is just dropped, which otherwise you might have put into thelabel. - It's just a bit ugly to send stuff that the client doesn't understand, and we it's not easy to notice this (previously: https://github.com/haskell/lsp/issues/306).
But doing better currently relies a lot of discipline to check the client capabilities everywhere and have lots of branching logic.
So here's an idea: provide a way to automatically downgrade a response to match the client capabilities. In many cases this will be trivial: drop the unsupported fields. But in other cases we can do a translation that does its best to carry on as much information as possible: turn an InsertReplaceTextEdit into a TextEdit by taking the insertion edit; drop labelDetails by adding it to the label, etc. And if we can't do anything we can perhaps emit a warning.
Take that, stick it in a typeclass, and then we can give people a generic downgrader that they can stick onto the end of their handlers to ensure they get appropriate output.
- 主要言語
- Haskell
- スター
- 426
- フォーク
- 107
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
haskell/lsp のほかの issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
-
Optimize `instance Eq NormalizedFilepath`?!対応中かも @sjakobi が 381 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
ZuriHac
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
haskell/bytestring#730 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
seal-harness/seal-harness#399 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
fmidue/codeworld-tasks#124 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
reflex-frp/reflex#563 ·