Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Prevent parent scope symbols leaking into module's scope

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
20/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
rust
領域
compilers

調査の方向性

まずスコープスタックのシンボル検索と create_default_context() を追跡し、次に FrameType と NU_LIB_DIRS などの定数がどのように表現されているかを調べます。Barrier フレームと Prelude フレームがモジュール分離、デフォルトコマンド、nupm オーバーレイとどのように相互作用すべきかを決定します。完了の条件は、親シンボル、Prelude コマンド、モジュールインポートを対象とするカバレッジを含め、検索ルールと NU_LIB_DIRS の動作が仕様化され、実装されていることです。

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

説明

Leaking user-defined symbols from a parent scope to a module's scope can lead to subtle bugs. The module's scope should be as isolated from the parent scope as possible, but not completely (e.g., we still need basic Nushell commands like ls to be visible).

Could be partially addressed by introducing two new FrameTypes:

  • Barrier: Stops symbol lookup when traversing the scope stack. This prevents the symbol lookup from searching the parent scopes.
  • Prelude: With only Barrier, we'd lose “default” commands that we want to be visible (like ls). Perhaps we could have a Prelude frame type which would get initialized first during create_default_context() with these default commands.

The question is what to do with constants like NU_LIB_DIRS, e.g.,:

const NU_LIB_DIRS = $NU_LIB_DIRS | append '/home/spam/foo`

module {
    use bar.nu  # should it look for 'bar.nu' in '/home/spam/foo'?
}

We might want to decide on this based on the envisioned functionality of how nupm is supposed to use overlays as “virtual environments”, relying on modifying the NU_LIB_DIRS constant.

主要言語
Rust
スター
36
フォーク
11
PR マージ指標
30日以内にマージされた PR はありません

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートなし
  • コントリビューションガイドを読む

はじめの一歩

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

nushell/new-nu-parser のほかの issue

nushell/new-nu-parser の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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