Function calls incorrectly formatted
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
調査の方向性
示されている Zeek のスニペットと tree-sitter の parse コマンドで問題を再現します。式と関数呼び出しのパースおよびフォーマットの挙動を追跡します。完了の条件は、隣接する呼び出しが正しい CST を生成し、長い呼び出しチェーンが引数の内部で途切れなくなり、すべての呼び出しを inlay hints 用に照合できることです。
索引モデルが issue の本文から書いたものです。
説明
When many function calls are part of the same expression they can be broken incorrectly, e.g., the following input
f(1) + f(1) +
f(1) + f(1) +
f(1) + f(1) +
f(1) + f(1) +
f(1) + f(1) +
f(1) + f(1) +
f(1) + f(1) +
f(1) + f(1);
is formatted with a line break inside the function call
f(1) + f(1) + f(1) + f(1) + f(1) + f(1) + f(1) + f(1) + f(1) + f(1) + f(1) + f(1) + f(
1) + f(1) + f(1) + f(1);
Looking at the produced CST this seems to be due to function calls in expressions not parsing correctly, e.g., with
f(1) + f(1);
I get
$ tree-sitter parse foo.zeek
(source_file [0, 0] - [1, 0]
(stmt [0, 0] - [0, 12]
(expr [0, 0] - [0, 11]
(expr [0, 0] - [0, 8]
(expr [0, 0] - [0, 4]
(expr [0, 0] - [0, 1]
(id [0, 0] - [0, 1]))
(expr_list [0, 2] - [0, 3]
(expr [0, 2] - [0, 3]
(constant [0, 2] - [0, 3]
(integer [0, 2] - [0, 3])))))
(expr [0, 7] - [0, 8]
(id [0, 7] - [0, 8])))
(expr_list [0, 9] - [0, 10]
(expr [0, 9] - [0, 10]
(constant [0, 9] - [0, 10]
(integer [0, 9] - [0, 10]))))))
(nl [0, 12] - [1, 0]))
If this had correct precedence I would expect two nodes (expr (expr (id)) (expr_list ...) next to each other; instead the function name of the second f gets incorrectly grouped next to the arguments of the first call.
The current "lightweight" impl also makes it impossible to match multiple function calls in the same expression, e.g., over in https://github.com/bbannier/zeek-language-server I cannot match all calls to compute parameter inlay hints, e.g.,
- 主要言語
- Python
- スター
- 11
- フォーク
- 4
- 平均マージ
- 3日 19時間
- マージ済み PR(30日)
- 1
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
zeek/zeekscript のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
zeek/zeekscript#137 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
zeek/zeekscript#120 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
zeek/zeekscript#91 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
zeek/zeekscript#83 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
zeek/zeekscript#63 ·
zeek/zeekscript の issue をすべて見る
似ている issue
-
agent-ready documentation needs-triage
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" オープン
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
instance instance add
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
searxng/searx-instances#939 · コメント 1 件 ·
-
area-deployment area-integrations triage:bot-seen
難易度 2/5 半日 初心者へのやさしさ 86/100