ruby / ruby/error_highlight

Unicode characters

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

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

主要言語
Ruby
スター
155
フォーク
37
平均マージ
4日 2時間
マージ済み PR(30日)
1

説明

Currently, error_highlight does not handle Unicode characters well. There are two subissues.

  1. Ruby::AST::Node#first_column and #last_column seem to return the column in bytes, but String#match handles the index in characters. We need to convert the column indexes.
  2. Some Unicode characters are displayed as two (or more?) columns in a terminal with monospace font.

(1) is relatively simple, but (2) is a bit tough. It requires a table telling how many columns each character has. It is known that Reline has such a table. But because error_highlight is a built-in gem that is loaded at Ruby process invocation, it is not good for error_highlight to depend on Reline (unless we make Reline a special built-in gem). We need to discuss how we make the table available to error_highlight.

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

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

調査の方向性

まず、Ruby::AST::Node#first_column と #last_column が String#match とどのように使用されているかを調べ、次に Reline の lib/reline/unicode/east_asian_width.rb にある Unicode の幅データと比較します。バイトインデックスの場合と端末幅の場合の両方を再現してください。完了には、文字変換について合意されたアプローチを確立し、不適切な依存関係なしで幅データを利用できるようにすることが必要です。

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

評価

技術スタック
ruby
領域
devtools
issue の種類
バグ
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

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

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