Skip to content

core: Rename VirtualList to List to match TSX - #4253

Open
huacnlee wants to merge 1 commit into
mainfrom
agent/T-13013-list-rename
Open

huacnlee wants to merge 1 commit into
mainfrom
agent/T-13013-list-rename

Conversation

@huacnlee

@huacnlee huacnlee commented Dec 3, 2026

Copy link
Copy Markdown
Member

Second batch of the pre-0.9.0 naming alignment (after #4252): the Rust list element now has the same name as the TSX one.

Before After TSX
virtual_list(count, row) list(count, row) <List>
VirtualList List —

nsh_core::prelude and nsh_core::element had no other List / list item, so nothing collides. Internal names (ElKind::VirtualList, VirtualListEl, the virtual_list module) are unchanged.

Migration

Old names still compile with a deprecation warning (#[deprecated(since = "0.9.0")]):

// before
let rows = virtual_list(count, row).keys(ids);
fn feed(list: VirtualList) -> VirtualList { .. }
// after
let rows = list(count, row).keys(ids);
fn feed(list: List) -> List { .. }

If a local variable named list is in scope (for example let list = element_ref();), it shadows the function; call nsh_core::element::list(..) there or rename the variable. Five call sites in this repo needed that.

Docs updated in English and zh-CN (website/), docs/dev, and the nsh skill references.

Testing

  • cargo check -p nsh-core -p nsh-base -p nsh-testing -p nsh-engine -p gallery-native -p tasks-rs --tests: 0 warnings, 0 errors (Linux).
  • cargo test -p nsh-core --lib -- unit_scan list: 204 passed.
  • cargo test -p nsh-engine --test engine rust_lists: 5 passed.
  • cargo test -p nsh-base --test base scrollbar: 18 passed.
  • Not built locally: macOS/iOS/Android/Windows crates and nsh-platform-macos tests (two test files changed); left to CI.

Risk

Public Rust API rename, source-compatible via deprecated aliases. Apps with #![deny(warnings)] will fail on the deprecation until they migrate. No behaviour change.

How to revert

Revert this PR.

🤖 Noop (rust-maintainer) · Opus 5.5 acting for @huacnlee

🤖 Generated with Claude Code

Rename the Rust list element `virtual_list()` / `VirtualList` to
`list()` / `List`, the name TSX already uses (`<List>`). The old names
stay as deprecated aliases so existing apps keep compiling.

Agent: rust-maintainer
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant