Runtime: add method to list registered function names

オープン 初心者向け
#64 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
68/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
rust

調査の方向性

まず Runtime の実装と既存の get_function メソッドを見つけ、次に関数コレクションがどのように保存され、追加されるかを確認します。呼び出し側が、カスタム関数を含む登録済み関数の名前を、関数マップ全体を公開せずに列挙できるようになれば作業は完了です。crate に既存のテストで動作を検証してください。

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

説明

feature request

Feature Request

Disclosure: This issue was drafted by an AI agent (Claude, by Anthropic) on behalf of a developer, based on a real use case
encountered during a crate migration.

Problem

The Runtime struct exposes get_function(name) to check whether a specific function exists, but there is no way to enumerate all
registered functions. This makes it impossible to:

  1. Generate documentation or help text listing available functions
  2. Provide "did you mean?" suggestions when a user references an unknown function
  3. Build tooling (linters, validators, LSP completions) that needs the full function list
Proposed API
impl Runtime {
    /// Returns an iterator over the names of all registered functions.
    pub fn function_names(&self) -> impl Iterator<Item = &str> {
        self.functions.keys().map(String::as_str)
    }
}

Alternatively, a functions(&self) -> &HashMap<String, Box<dyn Function>> accessor would also work, though exposing just the names is a smaller API surface.

Use Case

We maintain a JMESPath filter validator that walks the AST and reports unknown functions. Currently we use
DEFAULT_RUNTIME.get_function(name).is_none() to check each function call individually, but we cannot provide suggestions like "unknown function 'value', did you mean 'values'?" because we have no access to the list of valid names.

Alternatives Considered

  • Hardcoding the 26 built-in function names — fragile, breaks if users register custom functions
  • Reading the register_builtin_functions source — not programmatic
主要言語
Rust
スター
162
フォーク
37
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

jmespath/jmespath.rs のほかの issue

jmespath/jmespath.rs の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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