Support line wrap or fixed width in generated code snippet string

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
typescript
領域
tooling

調査の方向性

HTTPSnippet.convert エントリポイントから開始し、対象となるターゲット向けに生成されるコード文字列がどのように組み立てられているかを追跡します。ブール値オプションまたは幅オプションによって、他の出力を変更せずに長い値をどのように折り返すべきかを定義し、生成されたスニペットが要求されたフォーマット例と一致することを確認します。

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

説明

Hi, is there any plans to support a fixed width or line break for the generated string from HTTPSnippet.convert?

While generating the string, in certain use cases, the output string could be quite long for some lines, and seems like there is no options to have line break or line wrap.

For example, the following code snippet would be hard to view since it takes too much horizontal width (the url field):

import axios from 'axios';

const options = {
  method: 'POST',
  url: 'https://url.com/this_is_a_super_long_url_this_is_a_super_long_url_this_is_a_super_long_url_this_is_a_super_long_url_'
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}

If we could possibly add a line break (boolean, or width as a number) as an option:

import axios from 'axios';

const options = {
  method: 'POST',
  url: 'https://url.com/this_is_a_super_long_url
       _this_is_a_super_long_url_this_is_a_sup
       er_long_url_this_is_a_super_long_url_'
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
主要言語
TypeScript
スター
1.2k
フォーク
242
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

Kong/httpsnippet のほかの issue

Kong/httpsnippet の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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